mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 08:07:59 +01:00
Minor fixes/cleanup for last commit.
This commit is contained in:
@@ -260,20 +260,15 @@ var CommandWidgets = Class("CommandWidgets", {
|
|||||||
["viewable", "complete"].indexOf(elem.contentDocument.readyState) >= 0;
|
["viewable", "complete"].indexOf(elem.contentDocument.readyState) >= 0;
|
||||||
},
|
},
|
||||||
|
|
||||||
_whenReady: function _whenReady(id) {
|
_whenReady: function _whenReady(id, init) {
|
||||||
let elem = document.getElementById(id);
|
let elem = document.getElementById(id);
|
||||||
|
|
||||||
util.waitFor(bind(this._ready, this, elem));
|
|
||||||
|
|
||||||
return elem;
|
|
||||||
},
|
|
||||||
|
|
||||||
completionList: Class.memoize(function () {
|
|
||||||
let elem = document.getElementById(elem);
|
|
||||||
while (!this._ready(elem))
|
while (!this._ready(elem))
|
||||||
yield 10;
|
yield 10;
|
||||||
|
|
||||||
|
if (init)
|
||||||
|
init.call(this, elem);
|
||||||
yield elem;
|
yield elem;
|
||||||
}, true),
|
},
|
||||||
|
|
||||||
completionContainer: Class.memoize(function () this.completionList.parentNode),
|
completionContainer: Class.memoize(function () this.completionList.parentNode),
|
||||||
|
|
||||||
@@ -287,16 +282,11 @@ var CommandWidgets = Class("CommandWidgets", {
|
|||||||
return document.getElementById("dactyl-contextmenu");
|
return document.getElementById("dactyl-contextmenu");
|
||||||
}),
|
}),
|
||||||
|
|
||||||
multilineOutput: Class.memoize(function () {
|
multilineOutput: Class.memoize(function () this._whenReady("dactyl-multiline-output", function (elem) {
|
||||||
let elem = document.getElementById("dactyl-multiline-output");
|
|
||||||
while (!this._ready(elem))
|
|
||||||
yield 10;
|
|
||||||
|
|
||||||
elem.contentWindow.addEventListener("unload", function (event) { event.preventDefault(); }, true);
|
elem.contentWindow.addEventListener("unload", function (event) { event.preventDefault(); }, true);
|
||||||
elem.contentDocument.documentElement.id = "dactyl-multiline-output-top";
|
elem.contentDocument.documentElement.id = "dactyl-multiline-output-top";
|
||||||
elem.contentDocument.body.id = "dactyl-multiline-output-content";
|
elem.contentDocument.body.id = "dactyl-multiline-output-content";
|
||||||
yield elem;
|
}), true),
|
||||||
}, true),
|
|
||||||
|
|
||||||
multilineInput: Class.memoize(function () document.getElementById("dactyl-multiline-input")),
|
multilineInput: Class.memoize(function () document.getElementById("dactyl-multiline-input")),
|
||||||
|
|
||||||
@@ -581,7 +571,9 @@ var CommandLine = Module("commandline", {
|
|||||||
get completionList() {
|
get completionList() {
|
||||||
let node = this.widgets.active.commandline;
|
let node = this.widgets.active.commandline;
|
||||||
if (!node.completionList) {
|
if (!node.completionList) {
|
||||||
let elem = this.widgets._whenReady("dactyl-completions-" + node.id);
|
let elem = document.getElementById("dactyl-completions-" + node.id);
|
||||||
|
util.waitFor(bind(this.widgets._ready, null, elem));
|
||||||
|
|
||||||
node.completionList = ItemList(elem.id);
|
node.completionList = ItemList(elem.id);
|
||||||
}
|
}
|
||||||
return node.completionList;
|
return node.completionList;
|
||||||
|
|||||||
Reference in New Issue
Block a user