mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 05:38:01 +01:00
Another crack at revision c24f695526a9.
This commit is contained in:
@@ -251,13 +251,10 @@ const Buffer = Module("buffer", {
|
|||||||
|
|
||||||
buffer._triggerLoadAutocmd("PageLoadPre", webProgress.DOMWindow.document);
|
buffer._triggerLoadAutocmd("PageLoadPre", webProgress.DOMWindow.document);
|
||||||
|
|
||||||
// don't reset mode if a frame of the frameset gets reloaded which
|
if (document.commandDispatcher.focusedWindow == webProgress.DOMWindow && this.loadCount++)
|
||||||
// is not the focused frame
|
|
||||||
if (document.commandDispatcher.focusedWindow == webProgress.DOMWindow && this.loadCount++) {
|
|
||||||
util.timeout(function () { modes.reset(false); },
|
util.timeout(function () { modes.reset(false); },
|
||||||
dactyl.mode == modes.HINTS ? 500 : 0);
|
dactyl.mode == modes.HINTS ? 500 : 0);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if (flags & Ci.nsIWebProgressListener.STATE_STOP) {
|
else if (flags & Ci.nsIWebProgressListener.STATE_STOP) {
|
||||||
// Workaround for bugs 591425 and 606877, dactyl bug #81
|
// Workaround for bugs 591425 and 606877, dactyl bug #81
|
||||||
config.browser.mCurrentBrowser.collapsed = false;
|
config.browser.mCurrentBrowser.collapsed = false;
|
||||||
|
|||||||
@@ -370,13 +370,14 @@ const Dactyl = Module("dactyl", {
|
|||||||
return res;
|
return res;
|
||||||
},
|
},
|
||||||
|
|
||||||
focus: function (elem, flags) {
|
focus: function focus(elem, flags) {
|
||||||
flags = flags || services.focus.FLAG_BYMOUSE;
|
flags = flags || services.focus.FLAG_BYMOUSE;
|
||||||
|
util.dumpStack();
|
||||||
try {
|
try {
|
||||||
if (elem instanceof Document)
|
if (elem instanceof Document)
|
||||||
elem = elem.defaultView;
|
elem = elem.defaultView;
|
||||||
if (elem instanceof Window)
|
if (elem instanceof Window)
|
||||||
services.focus.clearFocus(elem);
|
services.focus.focusedWindow = elem;
|
||||||
else
|
else
|
||||||
services.focus.setFocus(elem, flags);
|
services.focus.setFocus(elem, flags);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@@ -391,7 +392,7 @@ const Dactyl = Module("dactyl", {
|
|||||||
* @param {boolean} clearFocusedElement Remove focus from any focused
|
* @param {boolean} clearFocusedElement Remove focus from any focused
|
||||||
* element.
|
* element.
|
||||||
*/
|
*/
|
||||||
focusContent: function (clearFocusedElement) {
|
focusContent: function focusContent(clearFocusedElement) {
|
||||||
if (window != services.windowWatcher.activeWindow)
|
if (window != services.windowWatcher.activeWindow)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -414,7 +415,8 @@ const Dactyl = Module("dactyl", {
|
|||||||
catch (e) {}
|
catch (e) {}
|
||||||
|
|
||||||
if (clearFocusedElement) {
|
if (clearFocusedElement) {
|
||||||
services.focus.clearFocus(window);
|
if (dactyl.focusedElement)
|
||||||
|
dactyl.focusedElement.blur();
|
||||||
if (win && Editor.getEditor(win)) {
|
if (win && Editor.getEditor(win)) {
|
||||||
win.blur();
|
win.blur();
|
||||||
if (win.frameElement)
|
if (win.frameElement)
|
||||||
@@ -431,6 +433,7 @@ const Dactyl = Module("dactyl", {
|
|||||||
|
|
||||||
/** @property {Element} The currently focused element. */
|
/** @property {Element} The currently focused element. */
|
||||||
get focusedElement() services.focus.getFocusedElementForWindow(window, true, {}),
|
get focusedElement() services.focus.getFocusedElementForWindow(window, true, {}),
|
||||||
|
set focusedElement(elem) dactyl.focus(elem),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether this Dactyl extension supports *feature*.
|
* Returns whether this Dactyl extension supports *feature*.
|
||||||
|
|||||||
@@ -286,6 +286,7 @@ const Modes = Module("modes", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
push: function push(mainMode, extendedMode, params) {
|
push: function push(mainMode, extendedMode, params) {
|
||||||
|
util.dumpStack();
|
||||||
this.set(mainMode, extendedMode, params, { push: this.topOfStack });
|
this.set(mainMode, extendedMode, params, { push: this.topOfStack });
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user