Bug 958993 - taping Clear button under Options several times creates multiple modal prompts.r=mbrubeck a=metro-only
authorAllison Naaktgeboren <ally@mozilla.com>
Fri, 17 Jan 2014 10:47:24 -0800
changeset 175938 a673eac28120315af742d9701eb7d66bce65b94b
parent 175937 4308bd949a964a247c2f95f4a4a426ce9aa921ba
child 175939 486101f1073a8920135d9b03881b88e07a2ef3e1
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmbrubeck, metro-only
bugs958993
milestone28.0a2
Bug 958993 - taping Clear button under Options several times creates multiple modal prompts.r=mbrubeck a=metro-only
browser/metro/base/content/browser-ui.js
--- a/browser/metro/base/content/browser-ui.js
+++ b/browser/metro/base/content/browser-ui.js
@@ -1084,32 +1084,37 @@ var BrowserUI = {
   },
 
   confirmSanitizeDialog: function () {
     let bundle = Services.strings.createBundle("chrome://browser/locale/browser.properties");
     let title = bundle.GetStringFromName("clearPrivateData.title");
     let message = bundle.GetStringFromName("clearPrivateData.message");
     let clearbutton = bundle.GetStringFromName("clearPrivateData.clearButton");
 
+    let prefsClearButton = document.getElementById("prefs-clear-data");
+    prefsClearButton.disabled = true; 
+
     let buttonPressed = Services.prompt.confirmEx(
                           null,
                           title,
                           message,
                           Ci.nsIPrompt.BUTTON_POS_0 * Ci.nsIPrompt.BUTTON_TITLE_IS_STRING +
                           Ci.nsIPrompt.BUTTON_POS_1 * Ci.nsIPrompt.BUTTON_TITLE_CANCEL,
                           clearbutton,
                           null,
                           null,
                           null,
                           { value: false });
 
     // Clicking 'Clear' will call onSanitize().
     if (buttonPressed === 0) {
       SanitizeUI.onSanitize();
     }
+
+    prefsClearButton.disabled = false;
   },
 };
 
 var PanelUI = {
   get _panels() { return document.getElementById("panel-items"); },
 
   get isVisible() {
     return !Elements.panelUI.hidden;