Skip to content

Commit

Permalink
Fix some button related bugs and add some missing styles
Browse files Browse the repository at this point in the history
  • Loading branch information
ASDosjani committed Sep 9, 2022
1 parent 7507fc0 commit 99bb4d6
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
12 changes: 12 additions & 0 deletions src/css/tabs/led_strip.less
Expand Up @@ -237,6 +237,12 @@
}
.modifiers {
display: inline-block;
.auxSelect {
border: 1px solid var(--subtleAccent);
border-radius: 3px;
background: var(--boxBackground);
color: var(--defaultText);
}
}
.colorDefineSliders {
display: inline-block;
Expand Down Expand Up @@ -358,6 +364,12 @@
button.btnOn {
border-color: #000;
}
.modeSelect {
border: 1px solid var(--subtleAccent);
border-radius: 3px;
background: var(--boxBackground);
color: var(--defaultText);
}
}
.indicators {
position: relative;
Expand Down
24 changes: 21 additions & 3 deletions src/js/tabs/led_strip.js
Expand Up @@ -100,7 +100,7 @@ led_strip.initialize = function (callback, scrollPosition) {

$('.auxSelect').val(getModeColor(AuxMode, AuxDir));

$('.auxSelect').on('change', function() {
$('.auxSelect').on('change',function() {
setModeColor(AuxMode, AuxDir, $('.auxSelect').val());
});
}
Expand Down Expand Up @@ -503,10 +503,28 @@ led_strip.initialize = function (callback, scrollPosition) {
}

// UI: check-box toggle
$('.checkbox').change(function(e) {
$('.checkbox').on('change',function(e) {
if (e.originalEvent) {
// user-triggered event
const that = $(this).find('input');

//disable Blink always or Larson scanner, both functions are not working properly at the same time
if (that.is('.function-o')) {
const blink = $('.checkbox .function-b');
if (blink.is(':checked')) {
blink.prop('checked', false);
blink.change();
toggleSwitch(blink, 'b');
}
} else if (that.is('.function-b')) {
const larson = $('.checkbox .function-o');
if ($('.checkbox .function-o').is(':checked')) {
larson.prop('checked', false);
larson.change();
toggleSwitch(larson, 'o');
}
}

if ($('.ui-selected').length > 0) {

TABS.led_strip.overlays.forEach(function(letter) {
Expand Down Expand Up @@ -1121,7 +1139,7 @@ led_strip.initialize = function (callback, scrollPosition) {
return mc.color;
}
}
return "";
return 3; //index of Throttle, use as default
}

function setModeColor(mode, dir, color) {
Expand Down

0 comments on commit 99bb4d6

Please sign in to comment.