Bug 1437486 - don't reset the forget button duration when the popup is visible, r?johannh
MozReview-Commit-ID: 6TWGSSuZxsa
--- a/browser/components/customizableui/CustomizableWidgets.jsm
+++ b/browser/components/customizableui/CustomizableWidgets.jsm
@@ -897,17 +897,16 @@ if (Services.prefs.getBoolPref("privacy.
id: "panic-button",
type: "view",
viewId: "PanelUI-panicView",
forgetButtonCalled(aEvent) {
let doc = aEvent.target.ownerDocument;
let group = doc.getElementById("PanelUI-panic-timeSpan");
BrowserUITelemetry.countPanicEvent(group.selectedItem.id);
- group.selectedItem = doc.getElementById("PanelUI-panic-5min");
let itemsToClear = [
"cookies", "history", "openWindows", "formdata", "sessions", "cache", "downloads"
];
let newWindowPrivateState = PrivateBrowsingUtils.isWindowPrivate(doc.defaultView) ?
"private" : "non-private";
let promise = Sanitizer.sanitize(itemsToClear, {
ignoreTimespan: false,
range: Sanitizer.getClearRange(+group.value),
@@ -929,16 +928,19 @@ if (Services.prefs.getBoolPref("privacy.
switch (aEvent.type) {
case "command":
this.forgetButtonCalled(aEvent);
break;
}
},
onViewShowing(aEvent) {
let forgetButton = aEvent.target.querySelector("#PanelUI-panic-view-button");
+ let doc = aEvent.target.ownerDocument;
+ let group = doc.getElementById("PanelUI-panic-timeSpan");
+ group.selectedItem = doc.getElementById("PanelUI-panic-5min");
forgetButton.addEventListener("command", this);
},
onViewHiding(aEvent) {
let forgetButton = aEvent.target.querySelector("#PanelUI-panic-view-button");
forgetButton.removeEventListener("command", this);
},
});
}