mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-23 16:25:22 +03:00
Language sort optionlist at LED tab (#3178)
* Sort 2 optionlist using sortSelect * Update led_strip.js Do the suggestion to code (and remove some blank lines)
This commit is contained in:
parent
b0f7ef669e
commit
ff5913b6cc
2 changed files with 9 additions and 21 deletions
|
@ -6,7 +6,6 @@ const led_strip = {
|
|||
directions: ['n', 'e', 's', 'w', 'u', 'd'],
|
||||
};
|
||||
|
||||
|
||||
led_strip.initialize = function (callback, scrollPosition) {
|
||||
let selectedColorIndex = null;
|
||||
let selectedModeColor = null;
|
||||
|
@ -34,7 +33,6 @@ led_strip.initialize = function (callback, scrollPosition) {
|
|||
MSP.send_message(MSPCodes.MSP_LED_STRIP_MODECOLOR, false, false, load_html);
|
||||
}
|
||||
|
||||
|
||||
function load_html() {
|
||||
$('#content').load("./tabs/led_strip.html", process_html);
|
||||
}
|
||||
|
@ -186,7 +184,6 @@ led_strip.initialize = function (callback, scrollPosition) {
|
|||
});
|
||||
|
||||
updateBulkCmd();
|
||||
|
||||
});
|
||||
|
||||
// Color sliders
|
||||
|
@ -217,7 +214,6 @@ led_strip.initialize = function (callback, scrollPosition) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
setColorSliders(selectedColorIndex);
|
||||
|
||||
$(this).addClass('btnOn');
|
||||
|
@ -396,6 +392,9 @@ led_strip.initialize = function (callback, scrollPosition) {
|
|||
},
|
||||
});
|
||||
|
||||
// Sort the element, if need to group, do it by lexical sort, ie. by naming of (the translated) selection text
|
||||
$('#ledStripFunctionSelect').sortSelect(i18n.getMessage("ledStripFunctionNoneOption"));
|
||||
|
||||
// UI: select LED function from drop-down
|
||||
$('.functionSelect').on('change', function() {
|
||||
clearModeColorSelection();
|
||||
|
@ -405,6 +404,9 @@ led_strip.initialize = function (callback, scrollPosition) {
|
|||
updateBulkCmd();
|
||||
});
|
||||
|
||||
// Sort the element, if need to group, do it by lexical sort, ie. by naming of (the translated) selection text
|
||||
$('#ledStripModeColorsModeSelect').sortSelect(i18n.getMessage("ledStripModeColorsModeOrientation"));
|
||||
|
||||
// UI: select mode from drop-down
|
||||
$('.modeSelect').on('change', function() {
|
||||
|
||||
|
@ -425,8 +427,7 @@ led_strip.initialize = function (callback, scrollPosition) {
|
|||
$('.mode_colors').each(function() { setModeBackgroundColor($(this)); });
|
||||
});
|
||||
|
||||
function toggleSwitch(that, letter)
|
||||
{
|
||||
function toggleSwitch(that, letter) {
|
||||
if ($(that).is(':checked')) {
|
||||
$('.ui-selected').find('.wire').each(function() {
|
||||
if ($(this).text() != "") {
|
||||
|
@ -528,8 +529,6 @@ led_strip.initialize = function (callback, scrollPosition) {
|
|||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
$('.mainGrid').disableSelection();
|
||||
|
||||
$('.gPoint').each(function(){
|
||||
|
@ -563,7 +562,6 @@ led_strip.initialize = function (callback, scrollPosition) {
|
|||
}
|
||||
|
||||
$(this).addClass(`color-${led.color}`);
|
||||
|
||||
});
|
||||
|
||||
$('a.save').on('click', function () {
|
||||
|
@ -582,7 +580,6 @@ led_strip.initialize = function (callback, scrollPosition) {
|
|||
GUI.log(i18n.getMessage('ledStripEepromSaved'));
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
colorDefineSliders.hide();
|
||||
|
@ -601,12 +598,6 @@ led_strip.initialize = function (callback, scrollPosition) {
|
|||
GUI.content_ready(callback);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function findLed(x, y) {
|
||||
for (let ledIndex = 0; ledIndex < FC.LED_STRIP.length; ledIndex++) {
|
||||
const led = FC.LED_STRIP[ledIndex];
|
||||
|
@ -617,7 +608,6 @@ led_strip.initialize = function (callback, scrollPosition) {
|
|||
return undefined;
|
||||
}
|
||||
|
||||
|
||||
function updateBulkCmd() {
|
||||
const ledStripLength = FC.LED_STRIP.length;
|
||||
|
||||
|
@ -943,7 +933,6 @@ led_strip.initialize = function (callback, scrollPosition) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// refresh color buttons
|
||||
$('.colors').children().each(function() { setBackgroundColor($(this)); });
|
||||
$('.overlay-color').each(function() { setBackgroundColor($(this)); });
|
||||
|
@ -1005,7 +994,6 @@ led_strip.initialize = function (callback, scrollPosition) {
|
|||
// only fire events when all values are set
|
||||
if (change)
|
||||
sliders.trigger('input');
|
||||
|
||||
}
|
||||
|
||||
function HsvToColor(input) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue