Save modification of bookmarks correctly from properties dialog

This commit is contained in:
YUKI Hiroshi 2016-01-21 20:03:58 +09:00
parent 508fa70336
commit eec6610169

View File

@ -80,9 +80,15 @@ var TreeStyleTabBookmarksServiceEditable = inherit(TreeStyleTabBookmarksUIServic
if ('BookmarkPropertiesPanel' in window) { if ('BookmarkPropertiesPanel' in window) {
BookmarkPropertiesPanel.__treestyletab__onDialogAccept = BookmarkPropertiesPanel.onDialogAccept; BookmarkPropertiesPanel.__treestyletab__onDialogAccept = BookmarkPropertiesPanel.onDialogAccept;
BookmarkPropertiesPanel.onDialogAccept = function(...aArgs) { BookmarkPropertiesPanel.onDialogAccept = function(...aArgs) {
this.__treestyletab__itemId = gEditItemOverlay.itemId; try {
TreeStyleTabBookmarksServiceEditable.saveParentFor(gEditItemOverlay.itemId, true);
}
catch(e) {
mydump(e+'\n');
}
return this.__treestyletab__onDialogAccept.apply(this, aArgs); return this.__treestyletab__onDialogAccept.apply(this, aArgs);
}; };
BookmarkPropertiesPanel.__treestyletab__endBatch = BookmarkPropertiesPanel._endBatch; BookmarkPropertiesPanel.__treestyletab__endBatch = BookmarkPropertiesPanel._endBatch;
BookmarkPropertiesPanel._endBatch = function(...aArgs) { BookmarkPropertiesPanel._endBatch = function(...aArgs) {
var id = this.__treestyletab__itemId || gEditItemOverlay.itemId; var id = this.__treestyletab__itemId || gEditItemOverlay.itemId;
@ -160,10 +166,10 @@ var TreeStyleTabBookmarksServiceEditable = inherit(TreeStyleTabBookmarksUIServic
}; };
gEditItemOverlay.__treestyletab__onItemMoved = gEditItemOverlay.onItemMoved; gEditItemOverlay.__treestyletab__onItemMoved = gEditItemOverlay.onItemMoved;
gEditItemOverlay.onItemMoved = function(...aArgs) { gEditItemOverlay.onItemMoved = function(aItemId, aOldParent, aOldIndex, aNewParent, aNewIndex, aItemType, ...aArgs) {
if (aNewParent == this._getFolderIdFromMenuList()) if (aNewParent == this._getFolderIdFromMenuList())
TreeStyleTabBookmarksServiceEditable.initParentMenuList(); TreeStyleTabBookmarksServiceEditable.initParentMenuList();
return this.__treestyletab__onItemMoved.apply(this, aArgs); return this.__treestyletab__onItemMoved.apply(this, [aItemId, aOldParent, aOldIndex, aNewParent, aNewIndex, aItemType].concat(aArgs));
}; };
this.editUIInitialized = true; this.editUIInitialized = true;