From b83ccdf146140af58d6fd8889d86c537553091c0 Mon Sep 17 00:00:00 2001 From: Asizon <43983086+Asizon@users.noreply.github.com> Date: Sun, 22 Aug 2021 13:15:27 +0200 Subject: [PATCH 1/3] Convert serial protocols to select2 --- src/js/tabs/receiver.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/js/tabs/receiver.js b/src/js/tabs/receiver.js index a9aafb6a..7ce8bf99 100644 --- a/src/js/tabs/receiver.js +++ b/src/js/tabs/receiver.js @@ -259,6 +259,15 @@ TABS.receiver.initialize = function (callback) { // select current serial RX type serialRxSelectElement.val(FC.RX_CONFIG.serialrx_provider); + // Convert to select2 and order alphabetic + serialRxSelectElement.select2({ + sorter(data) { + return data.sort(function(a, b) { + return a.text.localeCompare(b.text); + }); + }, + }); + if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_31)) { const spiRxTypes = [ 'NRF24_V202_250K', From 04b6edafbb5dcdd4ce52a1147b287f582c6da827 Mon Sep 17 00:00:00 2001 From: Asizon <43983086+Asizon@users.noreply.github.com> Date: Sun, 22 Aug 2021 13:28:37 +0200 Subject: [PATCH 2/3] Convert Spi rx protocolos to select2 --- src/js/tabs/receiver.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/js/tabs/receiver.js b/src/js/tabs/receiver.js index 7ce8bf99..9dae2d32 100644 --- a/src/js/tabs/receiver.js +++ b/src/js/tabs/receiver.js @@ -331,6 +331,15 @@ TABS.receiver.initialize = function (callback) { // select current serial RX type spiRxElement.val(FC.RX_CONFIG.rxSpiProtocol); + + // Convert to select2 and order alphabetic + spiRxElement.select2({ + sorter(data) { + return data.sort(function(a, b) { + return a.text.localeCompare(b.text); + }); + }, + }); } From 675e03889c958e5696f0a4999b7543b5ea982f5a Mon Sep 17 00:00:00 2001 From: Asizon <43983086+Asizon@users.noreply.github.com> Date: Sat, 28 Aug 2021 08:46:17 +0200 Subject: [PATCH 3/3] Dont aply Select2 on andoid --- src/js/tabs/receiver.js | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/src/js/tabs/receiver.js b/src/js/tabs/receiver.js index 9dae2d32..e8a98014 100644 --- a/src/js/tabs/receiver.js +++ b/src/js/tabs/receiver.js @@ -260,13 +260,15 @@ TABS.receiver.initialize = function (callback) { serialRxSelectElement.val(FC.RX_CONFIG.serialrx_provider); // Convert to select2 and order alphabetic - serialRxSelectElement.select2({ - sorter(data) { - return data.sort(function(a, b) { - return a.text.localeCompare(b.text); - }); - }, - }); + if (!GUI.isCordova()) { + serialRxSelectElement.select2({ + sorter(data) { + return data.sort(function(a, b) { + return a.text.localeCompare(b.text); + }); + }, + }); + } if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_31)) { const spiRxTypes = [ @@ -332,14 +334,16 @@ TABS.receiver.initialize = function (callback) { // select current serial RX type spiRxElement.val(FC.RX_CONFIG.rxSpiProtocol); - // Convert to select2 and order alphabetic - spiRxElement.select2({ - sorter(data) { - return data.sort(function(a, b) { - return a.text.localeCompare(b.text); - }); - }, - }); + if (!GUI.isCordova()) { + // Convert to select2 and order alphabetic + spiRxElement.select2({ + sorter(data) { + return data.sort(function(a, b) { + return a.text.localeCompare(b.text); + }); + }, + }); + } }