1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 05:37:58 +01:00

Do something remotely reasonable where designMode documents are concerned. Some fixes for evalInSandbox problems in recent nightlies.

This commit is contained in:
Kris Maglione
2010-10-24 20:21:14 -04:00
parent 6f95b33694
commit dc38a2208c
8 changed files with 86 additions and 76 deletions

View File

@@ -348,6 +348,7 @@ const Dactyl = Module("dactyl", {
if (window != services.get("windowWatcher").activeWindow)
return;
let win = document.commandDispatcher.focusedWindow;
let elem = config.mainWidget || window.content;
// TODO: make more generic
try {
@@ -357,16 +358,26 @@ const Dactyl = Module("dactyl", {
i = 0;
gDBView.selection.select(i);
}
else if (this.has("tabs")) {
else {
let frame = buffer.focusedFrame;
if (frame && frame.top == window.content)
if (frame && frame.top == window.content && !Editor.getEditor(frame))
elem = frame;
}
}
catch (e) {}
if (clearFocusedElement && dactyl.focus)
dactyl.focus.blur();
if (clearFocusedElement)
if (dactyl.focus)
dactyl.focus.blur();
else if (win) {
win.blur();
if (win.frameElement)
win.frameElement.blur();
}
if (elem instanceof Window && Editor.getEditor(elem))
elem = window;
if (elem && elem != dactyl.focus)
elem.focus();
},