Bug 566746 - various fixes to sanitize(). r=mak

This commit is contained in:
Mark Hammond
2013-05-09 09:08:07 +10:00
parent 04991d24e3
commit 65d594f18f
5 changed files with 49 additions and 27 deletions

View File

@@ -109,12 +109,23 @@ var gSanitizePromptDialog = {
s.range = Sanitizer.getClearRange(this.selectedTimespan);
s.ignoreTimespan = !s.range;
// As the sanitize is async, we disable the buttons, update the label on
// the 'accept' button to indicate things are happening and return false -
// once the async operation completes (either with or without errors)
// we close the window.
let docElt = document.documentElement;
let acceptButton = docElt.getButton("accept");
acceptButton.disabled = true;
acceptButton.setAttribute("label",
this.bundleBrowser.getString("sanitizeButtonClearing"));
docElt.getButton("cancel").disabled = true;
try {
s.sanitize();
s.sanitize().then(window.close, window.close);
} catch (er) {
Components.utils.reportError("Exception during sanitize: " + er);
return true; // We *do* want to close immediately on error.
}
return true;
return false;
},
/**