mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-11 05:35:45 +01:00
Fix Bookmark* autocommand events.
Struct now only offers values during iteration like Array.
This commit is contained in:
@@ -16,12 +16,12 @@ var Bookmarks = Module("bookmarks", {
|
|||||||
storage.addObserver("bookmark-cache", function (key, event, arg) {
|
storage.addObserver("bookmark-cache", function (key, event, arg) {
|
||||||
if (["add", "change", "remove"].indexOf(event) >= 0)
|
if (["add", "change", "remove"].indexOf(event) >= 0)
|
||||||
autocommands.trigger("Bookmark" + util.capitalize(event),
|
autocommands.trigger("Bookmark" + util.capitalize(event),
|
||||||
iter({
|
update({
|
||||||
bookmark: {
|
bookmark: {
|
||||||
toString: function () "bookmarkcache.bookmarks[" + arg.id + "]",
|
toString: function () "bookmarkcache.bookmarks[" + arg.id + "]",
|
||||||
valueOf: function () arg
|
valueOf: function () arg
|
||||||
}
|
}
|
||||||
}, arg).toObject());
|
}, arg.toObject()));
|
||||||
bookmarks.timer.tell();
|
bookmarks.timer.tell();
|
||||||
}, window);
|
}, window);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1405,6 +1405,10 @@ var StructBase = Class("StructBase", Array, {
|
|||||||
get: function struct_get(key, val) this[this.members[key]],
|
get: function struct_get(key, val) this[this.members[key]],
|
||||||
set: function struct_set(key, val) this[this.members[key]] = val,
|
set: function struct_set(key, val) this[this.members[key]] = val,
|
||||||
|
|
||||||
|
toObject: function struct_toObject() {
|
||||||
|
return iter.toObject([k, this[k]] for (k of keys(this.members)));
|
||||||
|
},
|
||||||
|
|
||||||
toString: function struct_toString() Class.prototype.toString.apply(this, arguments),
|
toString: function struct_toString() Class.prototype.toString.apply(this, arguments),
|
||||||
|
|
||||||
// Iterator over our named members
|
// Iterator over our named members
|
||||||
|
|||||||
Reference in New Issue
Block a user