mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-25 01:05:27 +03:00
Fixed selection and mode toggle behavior to include all modes within selection and to toggle all in selection rather than invert.
This commit is contained in:
parent
9d01ac417c
commit
7de513edfc
1 changed files with 30 additions and 10 deletions
|
@ -97,8 +97,13 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
if ($('.ui-selected').length > 0) {
|
if ($('.ui-selected').length > 0) {
|
||||||
TABS.led_strip.directions.forEach(function(letter) {
|
TABS.led_strip.directions.forEach(function(letter) {
|
||||||
if ($(that).is('.dir-' + letter)) {
|
if ($(that).is('.dir-' + letter)) {
|
||||||
$(that).toggleClass('btnOn');
|
if ($(that).is('.btnOn')) {
|
||||||
$('.ui-selected').toggleClass('dir-' + letter);
|
$(that).removeClass('btnOn');
|
||||||
|
$('.ui-selected').removeClass('dir-' + letter);
|
||||||
|
} else {
|
||||||
|
$(that).addClass('btnOn');
|
||||||
|
$('.ui-selected').addClass('dir-' + letter);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -113,8 +118,14 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
if ($('.ui-selected').length > 0) {
|
if ($('.ui-selected').length > 0) {
|
||||||
TABS.led_strip.functions.forEach(function(letter) {
|
TABS.led_strip.functions.forEach(function(letter) {
|
||||||
if ($(that).is('.function-' + letter)) {
|
if ($(that).is('.function-' + letter)) {
|
||||||
$(that).toggleClass('btnOn');
|
|
||||||
$('.ui-selected').toggleClass('function-' + letter);
|
if ($(that).is('.btnOn')) {
|
||||||
|
$(that).removeClass('btnOn');
|
||||||
|
$('.ui-selected').removeClass('function-' + letter);
|
||||||
|
} else {
|
||||||
|
$(that).addClass('btnOn');
|
||||||
|
$('.ui-selected').addClass('function-' + letter);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -165,6 +176,9 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
$('.mainGrid').selectable({
|
$('.mainGrid').selectable({
|
||||||
filter: ' > div',
|
filter: ' > div',
|
||||||
stop: function() {
|
stop: function() {
|
||||||
|
var modesInSelection = [];
|
||||||
|
var dirInSelection = [];
|
||||||
|
|
||||||
$('.ui-selected').each(function() {
|
$('.ui-selected').each(function() {
|
||||||
|
|
||||||
|
|
||||||
|
@ -188,18 +202,14 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
TABS.led_strip.directions.forEach(function(letter) {
|
TABS.led_strip.directions.forEach(function(letter) {
|
||||||
var className = '.dir-' + letter;
|
var className = '.dir-' + letter;
|
||||||
if ($(that).is(className)) {
|
if ($(that).is(className)) {
|
||||||
$(className).addClass('btnOn');
|
dirInSelection.push(className);
|
||||||
} else {
|
|
||||||
$(className).removeClass('btnOn');
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
TABS.led_strip.functions.forEach(function(letter) {
|
TABS.led_strip.functions.forEach(function(letter) {
|
||||||
var className = '.function-' + letter;
|
var className = '.function-' + letter;
|
||||||
if ($(that).is(className)) {
|
if ($(that).is(className)) {
|
||||||
$(className).addClass('btnOn');
|
modesInSelection.push(className);
|
||||||
} else {
|
|
||||||
$(className).removeClass('btnOn');
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -214,6 +224,16 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
|
|
||||||
updateBulkCmd();
|
updateBulkCmd();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('.functions button').removeClass('btnOn');
|
||||||
|
modesInSelection.forEach(function(eachMode) {
|
||||||
|
$(eachMode).addClass('btnOn');
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.directions button').removeClass('btnOn');
|
||||||
|
dirInSelection.forEach(function(eachMode) {
|
||||||
|
$(eachMode).addClass('btnOn');
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue