mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-22 02:09:28 +00:00
Bug 575896 - Reset bookmarks toolbar view during customization. r=dao
This commit is contained in:
parent
712786ecd5
commit
407994f6bc
@ -1067,30 +1067,24 @@ var PlacesStarButton = {
|
||||
// after closing the toolbar customization dialog.
|
||||
let PlacesToolbarHelper = {
|
||||
_place: "place:folder=TOOLBAR",
|
||||
_cachedElt: null,
|
||||
|
||||
onBrowserWindowClose: function PTH_onBrowserWindowClose() {
|
||||
if (this._cachedElt)
|
||||
this._cachedElt._placesView.uninit();
|
||||
get _viewElt() {
|
||||
return document.getElementById("PlacesToolbar");
|
||||
},
|
||||
|
||||
updateState: function PTH_updateState() {
|
||||
let currentElt = document.getElementById("PlacesToolbar");
|
||||
|
||||
// Bail out if the state has not changed.
|
||||
if (currentElt == this._cachedElt)
|
||||
return;
|
||||
|
||||
if (!this._cachedElt) {
|
||||
// The toolbar has been added.
|
||||
init: function PTH_init() {
|
||||
if (this._viewElt)
|
||||
new PlacesToolbar(this._place);
|
||||
this._cachedElt = currentElt;
|
||||
}
|
||||
else {
|
||||
// The toolbar has been removed.
|
||||
this._cachedElt._placesView.uninit();
|
||||
this._cachedElt = null;
|
||||
}
|
||||
},
|
||||
|
||||
customizeStart: function PTH_customizeStart() {
|
||||
let viewElt = this._viewElt;
|
||||
if (viewElt && viewElt._placesView)
|
||||
viewElt._placesView.uninit();
|
||||
},
|
||||
|
||||
customizeDone: function PTH_customizeDone() {
|
||||
this.init();
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1419,7 +1419,7 @@ function delayedStartup(isLoadingBlank, mustLoadSidebar) {
|
||||
dump("nsSessionStore could not be initialized: " + ex + "\n");
|
||||
}
|
||||
|
||||
PlacesToolbarHelper.updateState();
|
||||
PlacesToolbarHelper.init();
|
||||
|
||||
// bookmark-all-tabs command
|
||||
gBookmarkAllTabsHandler.init();
|
||||
@ -3420,6 +3420,7 @@ function BrowserCustomizeToolbar()
|
||||
|
||||
CombinedStopReload.uninit();
|
||||
|
||||
PlacesToolbarHelper.customizeStart();
|
||||
BookmarksMenuButton.customizeStart();
|
||||
|
||||
var customizeURL = "chrome://global/content/customizeToolbar.xul";
|
||||
@ -3483,7 +3484,7 @@ function BrowserToolboxCustomizeDone(aToolboxChanged) {
|
||||
#endif
|
||||
}
|
||||
|
||||
PlacesToolbarHelper.updateState();
|
||||
PlacesToolbarHelper.customizeDone();
|
||||
BookmarksMenuButton.customizeDone();
|
||||
|
||||
UpdateUrlbarSearchSplitterState();
|
||||
|
Loading…
x
Reference in New Issue
Block a user