extended "blur" behavior (using body click events)

This commit is contained in:
Jakob Ketterl 2021-03-31 02:01:13 +02:00
parent 02e699c597
commit 1932890dd0

View File

@ -115,6 +115,11 @@ TuneableFrequencyDisplay.prototype.setupEvents = function() {
}; };
$inputs = $.merge($(), me.input); $inputs = $.merge($(), me.input);
$inputs = $.merge($inputs, me.suffixInput); $inputs = $.merge($inputs, me.suffixInput);
$('body').on('click', function(e) {
if (!me.input.is(':visible')) return;
if ($.contains(me.element[0], e.target)) return;
submit();
});
$inputs.on('blur', function(e){ $inputs.on('blur', function(e){
if ($inputs.toArray().indexOf(e.relatedTarget) >= 0) { if ($inputs.toArray().indexOf(e.relatedTarget) >= 0) {
return; return;