mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 08:28:01 +01:00
Fix some initialization order issues.
This commit is contained in:
@@ -1390,7 +1390,7 @@ var CommandLine = Module("commandline", {
|
||||
subCommand: 0
|
||||
});
|
||||
},
|
||||
modes: function () {
|
||||
modes: function initModes() {
|
||||
modes.addMode("COMMAND_LINE", {
|
||||
char: "c",
|
||||
description: "Active when the command line is focused",
|
||||
|
||||
@@ -1115,7 +1115,8 @@ var Hints = Module("hints", {
|
||||
Mode: Struct("HintMode", "name", "prompt", "action", "tags", "filter")
|
||||
.localize("prompt")
|
||||
}, {
|
||||
modes: function () {
|
||||
modes: function initModes() {
|
||||
initModes.require("commandline");
|
||||
modes.addMode("HINTS", {
|
||||
extended: true,
|
||||
description: "Active when selecting elements in QuickHint or ExtendedHint mode",
|
||||
|
||||
@@ -426,6 +426,10 @@ var Modes = Module("modes", {
|
||||
}, {
|
||||
Mode: Class("Mode", {
|
||||
init: function init(name, options, params) {
|
||||
if (options.bases)
|
||||
util.assert(options.bases.every(function (m) m instanceof this, this.constructor),
|
||||
"Invalid bases", true);
|
||||
|
||||
update(this, {
|
||||
id: 1 << Modes.Mode._id++,
|
||||
name: name,
|
||||
|
||||
@@ -996,7 +996,8 @@ unlet s:cpo_save
|
||||
}]);
|
||||
|
||||
},
|
||||
modes: function (dactyl, modules, window) {
|
||||
modes: function initModes(dactyl, modules, window) {
|
||||
initModes.require("commandline");
|
||||
const { modes } = modules;
|
||||
|
||||
modes.addMode("FILE_INPUT", {
|
||||
|
||||
@@ -700,6 +700,7 @@ var JavaScript = Module("javascript", {
|
||||
});
|
||||
},
|
||||
modes: function initModes(dactyl, modules, window) {
|
||||
initModes.require("commandline");
|
||||
const { modes } = modules;
|
||||
|
||||
modes.addMode("REPL", {
|
||||
|
||||
@@ -931,7 +931,10 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
|
||||
let docShells = window.docShell.getDocShellEnumerator(Ci.nsIDocShellTreeItem[type],
|
||||
Ci.nsIDocShell.ENUMERATE_FORWARDS);
|
||||
while (docShells.hasMoreElements())
|
||||
yield docShells.getNext().QueryInterface(Ci.nsIDocShell).contentViewer.DOMDocument;
|
||||
let (viewer = docShells.getNext().QueryInterface(Ci.nsIDocShell).contentViewer) {
|
||||
if (viewer)
|
||||
yield viewer.DOMDocument;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user