1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 09:17:59 +01:00
This commit is contained in:
Kris Maglione
2008-11-25 07:46:15 +00:00
parent 3affc98ea5
commit 9e142cd761

View File

@@ -824,8 +824,8 @@ const liberator = (function () //{{{
{ {
let ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"] let ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
.getService(Components.interfaces.nsIWindowWatcher); .getService(Components.interfaces.nsIWindowWatcher);
if (window == ww.activeWindow && document.commandDispatcher.focusedElement && clearFocusedElement) if (window != ww.activeWindow)
document.commandDispatcher.focusedElement.blur(); return;
// TODO: make more generic // TODO: make more generic
try try
@@ -847,6 +847,8 @@ const liberator = (function () //{{{
if (frame && frame.top == window.content) if (frame && frame.top == window.content)
elem = frame; elem = frame;
} }
if (clearFocusedElement && document.commandDispatcher.focusedElement)
document.commandDispatcher.focusedElement.blur();
if (elem && (elem != document.commandDispatcher.focusedElement)) if (elem && (elem != document.commandDispatcher.focusedElement))
elem.focus(); elem.focus();
}, },