1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 17:12:28 +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:
Kris Maglione
2008-11-02 00:35:56 +00:00
parent 9c3fb60bc3
commit 0644de1458

View File

@@ -714,10 +714,11 @@ function CommandLine() //{{{
!(modes.extended & modes.OUTPUT_MULTILINE) &&
event.originalTarget == commandWidget.inputField)
{
let focus = document.commandDispatcher.focusedElement;
if (focus && focus.ownerDocument == content.document
|| focus instanceof HTMLInputElement)
liberator.beep();
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);
}