From fbf4d622722d0b632b7f2d596fe32507f23aa385 Mon Sep 17 00:00:00 2001 From: Markus Stange Date: Fri, 14 May 2010 12:20:00 +0200 Subject: [PATCH] Bug 549562 - Position the toolbar customization popup in repositionDialog() and make it invisible until it's positioned and loaded. r=gavin --- browser/base/content/browser.js | 13 ++++++++--- browser/base/content/browser.xul | 3 +-- .../base/content/test/browser_customize.js | 22 +++++++++++++++---- toolkit/content/customizeToolbar.js | 14 ++++++++---- 4 files changed, 39 insertions(+), 13 deletions(-) diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index a480f70de2cb..1ab1fedd6f9d 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -3310,8 +3310,10 @@ function BrowserCustomizeToolbar() if (gCustomizeSheet) { var sheetFrame = document.getElementById("customizeToolbarSheetIFrame"); + var panel = document.getElementById("customizeToolbarSheetPopup"); sheetFrame.hidden = false; sheetFrame.toolbox = gNavToolbox; + sheetFrame.panel = panel; // The document might not have been loaded yet, if this is the first time. // If it is already loaded, reload it so that the onload initialization code @@ -3321,9 +3323,14 @@ function BrowserCustomizeToolbar() else sheetFrame.setAttribute("src", customizeURL); - document.getElementById("customizeToolbarSheetPopup") - .openPopup(gNavToolbox, "after_start", 0, 0); - + // Open the panel, but make it invisible until the iframe has loaded so + // that the user doesn't see a white flash. + panel.style.visibility = "hidden"; + gNavToolbox.addEventListener("beforecustomization", function () { + gNavToolbox.removeEventListener("beforecustomization", arguments.callee, false); + panel.style.removeProperty("visibility"); + }, false); + panel.openPopup(gNavToolbox, "after_start", 0, 0); return sheetFrame.contentWindow; } else { return window.openDialog(customizeURL, diff --git a/browser/base/content/browser.xul b/browser/base/content/browser.xul index 7dd4afec4e54..25d310a16f1d 100644 --- a/browser/base/content/browser.xul +++ b/browser/base/content/browser.xul @@ -375,8 +375,7 @@ + noautohide="true">