зеркало из https://github.com/mozilla/gecko-dev.git
Bug 423747 - New Folder has inconsistent name in Bookmark Contextual Dialog. r=dietrich.
This commit is contained in:
Родитель
fe33a6d354
Коммит
ad5758b579
|
@ -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":
|
||||
|
|
Загрузка…
Ссылка в новой задаче