mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-30 13:45:27 +00:00
Bug 564188 - Live Bookmark status menuitem persists in menus. r=dietrich
This commit is contained in:
parent
8c61279fc2
commit
b724fe57d4
@ -412,6 +412,7 @@ PlacesViewBase.prototype = {
|
||||
lmStatusElt.setAttribute("disabled", true);
|
||||
aPopup.insertBefore(lmStatusElt,
|
||||
aPopup.childNodes.item(aPopup._startMarker + 1));
|
||||
aPopup._lmStatusMenuItem = lmStatusElt;
|
||||
aPopup._startMarker++;
|
||||
}
|
||||
else if (lmStatus && lmStatusElt.getAttribute("lmStatus") != lmStatus) {
|
||||
|
@ -1248,47 +1248,6 @@ var PlacesUIUtils = {
|
||||
return queryName;
|
||||
},
|
||||
|
||||
/**
|
||||
* Add, update or remove the livemark status menuitem.
|
||||
* @param aPopup
|
||||
* The livemark container popup
|
||||
*/
|
||||
ensureLivemarkStatusMenuItem:
|
||||
function PUIU_ensureLivemarkStatusMenuItem(aPopup) {
|
||||
var itemId = aPopup._resultNode.itemId;
|
||||
|
||||
var lmStatus = null;
|
||||
if (PlacesUtils.annotations
|
||||
.itemHasAnnotation(itemId, "livemark/loadfailed"))
|
||||
lmStatus = "bookmarksLivemarkFailed";
|
||||
else if (PlacesUtils.annotations
|
||||
.itemHasAnnotation(itemId, "livemark/loading"))
|
||||
lmStatus = "bookmarksLivemarkLoading";
|
||||
|
||||
if (lmStatus && !aPopup._lmStatusMenuItem) {
|
||||
// Create the status menuitem and cache it in the popup object.
|
||||
let document = aPopup.ownerDocument;
|
||||
aPopup._lmStatusMenuItem = document.createElement("menuitem");
|
||||
aPopup._lmStatusMenuItem.setAttribute("lmStatus", lmStatus);
|
||||
aPopup._lmStatusMenuItem.setAttribute("label", this.getString(lmStatus));
|
||||
aPopup._lmStatusMenuItem.setAttribute("disabled", true);
|
||||
aPopup.insertBefore(aPopup._lmStatusMenuItem,
|
||||
aPopup.childNodes.item(aPopup._startMarker + 1));
|
||||
aPopup._startMarker++;
|
||||
}
|
||||
else if (lmStatus &&
|
||||
aPopup._lmStatusMenuItem.getAttribute("lmStatus") != lmStatus) {
|
||||
// Status has changed, update the cached status menuitem.
|
||||
aPopup._lmStatusMenuItem.setAttribute("label",
|
||||
this.getString(lmStatus));
|
||||
}
|
||||
else if (!lmStatus && aPopup._lmStatusMenuItem){
|
||||
// No status, remove the cached menuitem.
|
||||
aPopup.removeChild(aPopup._lmStatusMenuItem);
|
||||
aPopup._lmStatusMenuItem = null;
|
||||
aPopup._startMarker--;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
XPCOMUtils.defineLazyServiceGetter(PlacesUIUtils, "RDF",
|
||||
|
Loading…
Reference in New Issue
Block a user