mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1219788 - Show bookmarks toolbar when adding a bookmark to the bookmarks toolbar folder. r=mak
This commit is contained in:
parent
62ead7eab4
commit
3ca1388e6a
@ -1817,3 +1817,44 @@ var BookmarkingUI = {
|
||||
Ci.nsINavBookmarkObserver
|
||||
])
|
||||
};
|
||||
|
||||
var AutoShowBookmarksToolbar = {
|
||||
init() {
|
||||
PlacesUtils.addLazyBookmarkObserver(this, false);
|
||||
},
|
||||
|
||||
uninit() {
|
||||
PlacesUtils.removeLazyBookmarkObserver(this);
|
||||
},
|
||||
|
||||
onItemAdded(aItemId, aParentId, aIndex, aItemType, aURI, aTitle, aDateAdded,
|
||||
aGuid, aParentGuid) {
|
||||
this._autoshow(aParentGuid);
|
||||
},
|
||||
onBeginUpdateBatch() {},
|
||||
onEndUpdateBatch() {},
|
||||
onItemRemoved() {},
|
||||
onItemChanged() {},
|
||||
onItemVisited() {},
|
||||
onItemMoved(aItemId, aOldParent, aOldIndex, aNewParent, aNewIndex, aItemType,
|
||||
aGuid, aOldParentGuid, aNewParentGuid) {
|
||||
this._autoshow(aNewParentGuid);
|
||||
},
|
||||
|
||||
_autoshow(aParentGuid) {
|
||||
if (aParentGuid != PlacesUtils.bookmarks.toolbarGuid)
|
||||
return;
|
||||
|
||||
let toolbar = document.getElementById("PersonalToolbar");
|
||||
if (!toolbar.collapsed)
|
||||
return;
|
||||
|
||||
let placement = CustomizableUI.getPlacementOfWidget("personal-bookmarks");
|
||||
let area = placement && placement.area;
|
||||
if (area != CustomizableUI.AREA_BOOKMARKS)
|
||||
return;
|
||||
|
||||
setToolbarVisibility(toolbar, true);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1188,6 +1188,7 @@ var gBrowserInit = {
|
||||
gBrowser.tabContainer.updateVisibility();
|
||||
|
||||
BookmarkingUI.init();
|
||||
AutoShowBookmarksToolbar.init();
|
||||
|
||||
gPrefService.addObserver(gHomeButton.prefDomain, gHomeButton, false);
|
||||
|
||||
@ -1422,8 +1423,6 @@ var gBrowserInit = {
|
||||
|
||||
PlacesToolbarHelper.uninit();
|
||||
|
||||
BookmarkingUI.uninit();
|
||||
|
||||
TabsInTitlebar.uninit();
|
||||
|
||||
ToolbarIconColor.uninit();
|
||||
@ -1484,6 +1483,8 @@ var gBrowserInit = {
|
||||
IndexedDBPromptHelper.uninit();
|
||||
LightweightThemeListener.uninit();
|
||||
PanelUI.uninit();
|
||||
BookmarkingUI.uninit();
|
||||
AutoShowBookmarksToolbar.uninit();
|
||||
}
|
||||
|
||||
// Final window teardown, do this last.
|
||||
|
Loading…
Reference in New Issue
Block a user