mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-07 09:54:42 +00:00
Bug 1392081 - Reset the Places toolbar view when the toolbar is collapsed. r=Gijs
MozReview-Commit-ID: IFOxCnslZRX --HG-- extra : rebase_source : 6605bd328273fb283e62a74ee14ca37aaaf6c4c8
This commit is contained in:
parent
8fe846e658
commit
b3ab6629a6
@ -1162,6 +1162,11 @@ var PlacesToolbarHelper = {
|
||||
// call this multiple times.
|
||||
CustomizableUI.addListener(this);
|
||||
|
||||
if (!this._isObservingToolbars) {
|
||||
this._isObservingToolbars = true;
|
||||
window.addEventListener("toolbarvisibilitychange", this);
|
||||
}
|
||||
|
||||
// If the bookmarks toolbar item is:
|
||||
// - not in a toolbar, or;
|
||||
// - the toolbar is collapsed, or;
|
||||
@ -1170,8 +1175,9 @@ var PlacesToolbarHelper = {
|
||||
// customizing, because that will happen when the customization is done.
|
||||
let toolbar = this._getParentToolbar(viewElt);
|
||||
if (!toolbar || toolbar.collapsed || this._isCustomizing ||
|
||||
getComputedStyle(toolbar, "").display == "none")
|
||||
getComputedStyle(toolbar, "").display == "none") {
|
||||
return;
|
||||
}
|
||||
|
||||
new PlacesToolbar(this._place);
|
||||
if (forceToolbarOverflowCheck) {
|
||||
@ -1179,7 +1185,20 @@ var PlacesToolbarHelper = {
|
||||
}
|
||||
},
|
||||
|
||||
handleEvent(event) {
|
||||
switch (event.type) {
|
||||
case "toolbarvisibilitychange":
|
||||
if (event.target == this._viewElt.parentNode.parentNode)
|
||||
this._resetView();
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
uninit: function PTH_uninit() {
|
||||
if (this._isObservingToolbars) {
|
||||
delete this._isObservingToolbars;
|
||||
window.removeEventListener("toolbarvisibilitychange", this);
|
||||
}
|
||||
CustomizableUI.removeListener(this);
|
||||
},
|
||||
|
||||
|
@ -5531,7 +5531,6 @@ function setToolbarVisibility(toolbar, isVisible, persist = true) {
|
||||
let event = new CustomEvent("toolbarvisibilitychange", eventParams);
|
||||
toolbar.dispatchEvent(event);
|
||||
|
||||
PlacesToolbarHelper.init();
|
||||
BookmarkingUI.onToolbarVisibilityChange();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user