1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-22 21:27:58 +01:00

Simplify bookmark loading code.

This commit is contained in:
Kris Maglione
2011-09-30 23:54:53 -04:00
parent 625c3cef8b
commit 119f117e4d
2 changed files with 30 additions and 26 deletions

View File

@@ -35,15 +35,19 @@ var History = Module("history", {
let root = services.history.executeQuery(query, options).root;
root.containerOpen = true;
let items = iter(util.range(0, root.childCount)).map(function (i) {
let node = root.getChild(i);
return {
url: node.uri,
title: node.title,
icon: node.icon ? node.icon : DEFAULT_FAVICON
};
}).toArray();
root.containerOpen = false;
try {
let items = iter(util.range(0, root.childCount)).map(function (i) {
let node = root.getChild(i);
return {
url: node.uri,
title: node.title,
icon: node.icon ? node.icon : DEFAULT_FAVICON
};
}).toArray();
}
finally {
root.containerOpen = false;
}
return items;
},