mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 07:28:00 +01:00
Merge branch default.
--HG-- branch : bootstrapped
This commit is contained in:
@@ -389,13 +389,14 @@ const Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase),
|
||||
return res;
|
||||
},
|
||||
|
||||
focus: function (elem, flags) {
|
||||
focus: function focus(elem, flags) {
|
||||
flags = flags || services.focus.FLAG_BYMOUSE;
|
||||
util.dumpStack();
|
||||
try {
|
||||
if (elem instanceof Document)
|
||||
elem = elem.defaultView;
|
||||
if (elem instanceof Window)
|
||||
services.focus.clearFocus(elem);
|
||||
services.focus.focusedWindow = elem;
|
||||
else
|
||||
services.focus.setFocus(elem, flags);
|
||||
} catch (e) {
|
||||
@@ -410,7 +411,7 @@ const Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase),
|
||||
* @param {boolean} clearFocusedElement Remove focus from any focused
|
||||
* element.
|
||||
*/
|
||||
focusContent: function (clearFocusedElement) {
|
||||
focusContent: function focusContent(clearFocusedElement) {
|
||||
if (window != services.windowWatcher.activeWindow)
|
||||
return;
|
||||
|
||||
@@ -433,7 +434,8 @@ const Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase),
|
||||
catch (e) {}
|
||||
|
||||
if (clearFocusedElement) {
|
||||
services.focus.clearFocus(window);
|
||||
if (dactyl.focusedElement)
|
||||
dactyl.focusedElement.blur();
|
||||
if (win && Editor.getEditor(win)) {
|
||||
win.blur();
|
||||
if (win.frameElement)
|
||||
@@ -450,6 +452,7 @@ const Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase),
|
||||
|
||||
/** @property {Element} The currently focused element. */
|
||||
get focusedElement() services.focus.getFocusedElementForWindow(window, true, {}),
|
||||
set focusedElement(elem) dactyl.focus(elem),
|
||||
|
||||
/**
|
||||
* Returns whether this Dactyl extension supports *feature*.
|
||||
|
||||
Reference in New Issue
Block a user