From ad5758b57914c3e2dcd50b27d893e27c6d18bcfd Mon Sep 17 00:00:00 2001 From: "mozilla.mano@sent.com" Date: Tue, 1 Apr 2008 18:42:01 -0700 Subject: [PATCH] Bug 423747 - New Folder has inconsistent name in Bookmark Contextual Dialog. r=dietrich. --- .../places/content/editBookmarkOverlay.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/browser/components/places/content/editBookmarkOverlay.js b/browser/components/places/content/editBookmarkOverlay.js index 036094716509..e470595f7c44 100644 --- a/browser/components/places/content/editBookmarkOverlay.js +++ b/browser/components/places/content/editBookmarkOverlay.js @@ -777,7 +777,8 @@ var gEditItemOverlay = { var ip = this._folderTree.insertionPoint; // default to the bookmarks menu folder - if (ip.itemId == PlacesUIUtils.allBookmarksFolderId || + if (!ip || + ip.itemId == PlacesUIUtils.allBookmarksFolderId || ip.itemId == PlacesUIUtils.unfiledBookmarksFolderId) { ip.itemId = PlacesUtils.bookmarksMenuFolderId; ip.index = -1; @@ -819,8 +820,22 @@ var gEditItemOverlay = { // nsINavBookmarkObserver onItemChanged: function EIO_onItemChanged(aItemId, aProperty, aIsAnnotationProperty, aValue) { - if (this._itemId != aItemId) + if (this._itemId != aItemId) { + if (aProperty == "title") { + // If the title of a folder which is listed within the folders + // menulist has been changed, we need to update the label of its + // representing element. + var menupopup = this._folderMenuList.menupopup; + for (var i=0; i < menupopup.childNodes.length; i++) { + if (menupopup.childNodes[i].folderId == aItemId) { + menupopup.childNodes[i].label = aValue; + break; + } + } + } + return; + } switch (aProperty) { case "title":