diff options
author | Kris Maglione <maglione.k@gmail.com> | 2010-12-18 15:27:45 -0500 |
---|---|---|
committer | Kris Maglione <maglione.k@gmail.com> | 2010-12-18 15:27:45 -0500 |
commit | 4ff7172c77b5f04fcc71c3c6e176f4c259540c8f (patch) | |
tree | 7d1e0d1c419e96eb0861689f345a749ca992e165 /common/content/editor.js | |
parent | 0af241568b04ce187acfa6e1a06b6ccbfa88bd6f (diff) | |
download | pentadactyl-4ff7172c77b5f04fcc71c3c6e176f4c259540c8f.tar.gz |
Import the bulk of a focus management patch near the top of my queue.
Diffstat (limited to 'common/content/editor.js')
-rw-r--r-- | common/content/editor.js | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/common/content/editor.js b/common/content/editor.js index c79c89c5..05ea807c 100644 --- a/common/content/editor.js +++ b/common/content/editor.js @@ -30,7 +30,7 @@ const Editor = Module("editor", { return; } - let elem = dactyl.focus; + let elem = dactyl.focusedElement; if (elem.setSelectionRange) { let text = dactyl.clipboardRead(clipboard); @@ -254,7 +254,7 @@ const Editor = Module("editor", { if (!options["editor"]) return; - let textBox = config.isComposeWindow ? null : dactyl.focus; + let textBox = config.isComposeWindow ? null : dactyl.focusedElement; let line, column; if (!forceEditing && textBox && textBox.type == "password") { @@ -373,12 +373,12 @@ const Editor = Module("editor", { }, { getEditor: function (elem) { if (arguments.length === 0) { - dactyl.assert(dactyl.focus); - return dactyl.focus; + dactyl.assert(dactyl.focusedElement); + return dactyl.focusedElement; } if (!elem) - elem = dactyl.focus || document.commandDispatcher.focusedWindow; + elem = dactyl.focusedElement || document.commandDispatcher.focusedWindow; dactyl.assert(elem); if (elem instanceof Element) @@ -394,7 +394,7 @@ const Editor = Module("editor", { }, getController: function () { - let ed = dactyl.focus; + let ed = dactyl.focusedElement; if (!ed || !ed.controllers) return null; @@ -597,7 +597,8 @@ const Editor = Module("editor", { ["<Tab>"], "Expand insert mode abbreviation", function () { editor.expandAbbreviation(modes.INSERT); - document.commandDispatcher.advanceFocus(); + services.focus.moveFocus(window, null, Ci.nsIFocusManager.MOVEFOCUS_FORWARD, + Ci.nsIFocusManager.FLAG_BYKEY); }); mappings.add([modes.INSERT], |