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:
@@ -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;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user