Bug 566746 - various fixes to sanitize(). r=mak
This commit is contained in:
@@ -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;
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user