From 0644de14585ab0b02d7de69876ec3dfe1dacef44 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Sun, 2 Nov 2008 00:35:56 +0000 Subject: [PATCH] Beep when the commandline loses focus *if* the new focus is an input element or in the content document --- content/ui.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/content/ui.js b/content/ui.js index 91f747f9..02871b39 100644 --- a/content/ui.js +++ b/content/ui.js @@ -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); }