waterfall config fine-adjustments

* hide the waterfall colors input when pre-defined color scheme is
  selected
* skip unparseable lines on custom color input
* fallback to black and white if custom color config is unusable
* always use the waterfall classes when sending changes to the client
This commit is contained in:
Jakob Ketterl
2021-02-16 18:35:18 +01:00
parent 9aebeb51f8
commit 691d88f841
6 changed files with 30 additions and 8 deletions

View File

@ -0,0 +1,11 @@
$.fn.waterfallDropdown = function(){
this.each(function(){
var $select = $(this);
var setVisibility = function() {
var show = $select.val() === 'CUSTOM';
$('#waterfall_colors').parents('.form-group')[show ? 'show' : 'hide']();
}
$select.on('change', setVisibility);
setVisibility();
})
}

View File

@ -4,4 +4,5 @@ $(function(){
$('.imageupload').imageUpload();
$('.bookmarks').bookmarktable();
$('.wsjt-decoding-depths').wsjtDecodingDepthsInput();
$('#waterfall_scheme').waterfallDropdown();
});