Bug 973153 - disable (undo) reset buttons at the start of Australis' customize mode transitions to prevent breakage, r=Unfocused
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Sun, 16 Feb 2014 00:15:06 +0000
changeset 169429 dffffd86b592547249f1be66fc0ef52c63b71153
parent 169411 494ca694e7686c31db24633c63ee1c2a3903667a
child 169430 314377c20d231831969f044e0877caa8f5a610e8
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersUnfocused
bugs973153
milestone30.0a1
Bug 973153 - disable (undo) reset buttons at the start of Australis' customize mode transitions to prevent breakage, r=Unfocused
browser/components/customizableui/src/CustomizeMode.jsm
--- a/browser/components/customizableui/src/CustomizeMode.jsm
+++ b/browser/components/customizableui/src/CustomizeMode.jsm
@@ -131,16 +131,21 @@ CustomizeMode.prototype = {
       return;
     }
 
     let window = this.window;
     let document = this.document;
 
     this._handler.isEnteringCustomizeMode = true;
 
+    // Always disable the reset button at the start of customize mode, it'll be re-enabled
+    // if necessary when we finish entering:
+    let resetButton = this.document.getElementById("customization-reset-button");
+    resetButton.setAttribute("disabled", "true");
+
     Task.spawn(function() {
       // We shouldn't start customize mode until after browser-delayed-startup has finished:
       if (!this.window.gBrowserInit.delayedStartupFinished) {
         let delayedStartupDeferred = Promise.defer();
         let delayedStartupObserver = function(aSubject) {
           if (aSubject == this.window) {
             Services.obs.removeObserver(delayedStartupObserver, "browser-delayed-startup-finished");
             delayedStartupDeferred.resolve();
@@ -308,16 +313,21 @@ CustomizeMode.prototype = {
     this.visiblePalette.hidden = true;
     this.paletteEmptyNotice.hidden = true;
 
     // Disable the button-text fade-out mask
     // during the transition for increased perf.
     let panelContents = window.PanelUI.contents;
     panelContents.setAttribute("customize-transitioning", "true");
 
+    // Disable the reset and undo reset buttons while transitioning:
+    let resetButton = this.document.getElementById("customization-reset-button");
+    let undoResetButton = this.document.getElementById("customization-undo-reset-button");
+    undoResetButton.hidden = resetButton.disabled = true;
+
     this._transitioning = true;
 
     Task.spawn(function() {
       yield this.depopulatePalette();
 
       yield this._doTransition(false);
 
       let customizer = document.getElementById("customization-container");