mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 21:22:26 +01:00
Beep when the commandline loses focus *if* the new focus is an input element or in the content document
This commit is contained in:
@@ -714,10 +714,11 @@ function CommandLine() //{{{
|
|||||||
!(modes.extended & modes.OUTPUT_MULTILINE) &&
|
!(modes.extended & modes.OUTPUT_MULTILINE) &&
|
||||||
event.originalTarget == commandWidget.inputField)
|
event.originalTarget == commandWidget.inputField)
|
||||||
{
|
{
|
||||||
|
let focus = document.commandDispatcher.focusedElement;
|
||||||
|
if (focus && focus.ownerDocument == content.document
|
||||||
|
|| focus instanceof HTMLInputElement)
|
||||||
|
liberator.beep();
|
||||||
commandWidget.inputField.focus();
|
commandWidget.inputField.focus();
|
||||||
// a beep would be nice, but unfortunately firefox also fires
|
|
||||||
// this event when switching windows while the command line has focus
|
|
||||||
// liberator.beep();
|
|
||||||
}
|
}
|
||||||
}, 0);
|
}, 0);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user