mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-01 22:55:23 +00:00
Bug 575558 - New empty named bookmarks in the toolbar display the URL instead. r=dietrich
This commit is contained in:
parent
641a367e54
commit
dded36fc44
@ -495,7 +495,15 @@ PlacesViewBase.prototype = {
|
||||
if (elt.localName == "menupopup")
|
||||
elt = elt.parentNode;
|
||||
|
||||
elt.label = aNewTitle || PlacesUIUtils.getBestTitle(aPlacesNode);
|
||||
if (!aNewTitle && elt.localName != "toolbarbutton") {
|
||||
// Many users consider toolbars as shortcuts containers, so explicitly
|
||||
// allow empty labels on toolbarbuttons. For any other element try to be
|
||||
// smarter, guessing a title from the uri.
|
||||
elt.label = PlacesUIUtils.getBestTitle(aPlacesNode);
|
||||
}
|
||||
else {
|
||||
elt.label = aNewTitle;
|
||||
}
|
||||
},
|
||||
|
||||
nodeRemoved:
|
||||
|
@ -104,7 +104,7 @@ function startTest() {
|
||||
PlacesUtils._uri("place:"),
|
||||
bs.DEFAULT_INDEX,
|
||||
"bm2");
|
||||
bs.setItemTitle(id, "bm2_edited");
|
||||
bs.setItemTitle(id, "");
|
||||
addedBookmarks.push(id);
|
||||
id = bs.insertSeparator(bs.bookmarksMenuFolder, bs.DEFAULT_INDEX);
|
||||
addedBookmarks.push(id);
|
||||
@ -135,7 +135,7 @@ function startTest() {
|
||||
PlacesUtils._uri("place:"),
|
||||
bs.DEFAULT_INDEX,
|
||||
"tb2");
|
||||
bs.setItemTitle(id, "tb2_edited");
|
||||
bs.setItemTitle(id, "");
|
||||
addedBookmarks.push(id);
|
||||
id = bs.insertSeparator(bs.toolbarFolder, bs.DEFAULT_INDEX);
|
||||
addedBookmarks.push(id);
|
||||
@ -285,9 +285,13 @@ var bookmarksObserver = {
|
||||
var tree = sidebar.contentDocument.getElementById("bookmarks-view");
|
||||
let cellText = tree.view.getCellText(aElementOrTreeIndex,
|
||||
tree.columns.getColumnAt(0));
|
||||
if (!aNewValue)
|
||||
return cellText == PlacesUIUtils.getBestTitle(tree.view.nodeForTreeIndex(aElementOrTreeIndex));
|
||||
return cellText == aNewValue;
|
||||
}
|
||||
else {
|
||||
if (!aNewValue && aElementOrTreeIndex.localName != "toolbarbutton")
|
||||
return aElementOrTreeIndex.label == PlacesUIUtils.getBestTitle(aElementOrTreeIndex._placesNode);
|
||||
return aElementOrTreeIndex.label == aNewValue;
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user