1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 00:07:59 +01:00

Minor cleanup.

This commit is contained in:
Kris Maglione
2011-02-07 23:12:09 -05:00
parent 9f0cecb9f7
commit 0290f6ebcd
4 changed files with 14 additions and 15 deletions

View File

@@ -260,9 +260,10 @@ var CommandWidgets = Class("CommandWidgets", {
configurable: true, enumerable: true,
get: function get_whenReady() {
let elem = document.getElementById(id);
while (elem.contentDocument.documentURI != elem.getAttribute("src") ||
["viewable", "complete"].indexOf(elem.contentDocument.readyState) < 0)
util.threadYield();
util.waitFor(function () elem.contentDocument.documentURI === elem.getAttribute("src") &&
["viewable", "complete"].indexOf(elem.contentDocument.readyState) >= 0);
res = res || (processor || util.identity).call(self, elem);
return res;
}
@@ -1189,9 +1190,8 @@ var CommandLine = Module("commandline", {
this.waiting = true;
for (let [, context] in Iterator(list)) {
let done = function done() !(idx >= n + context.items.length || idx == -2 && !context.items.length);
while (context.incomplete && !done())
util.threadYield(false, true);
util.waitFor(function () !context.incomplete || done())
if (done())
break;
@@ -1420,7 +1420,7 @@ var CommandLine = Module("commandline", {
let command = commandline.command;
self.accepted = true;
return function () modes.pop();
return function () { modes.pop(); };
});
[