Skip to content

Commit 05e3016

Browse files
committed
Bug 1878701 - Part 2: Make DLP busy dialog have a gray Cancel button r=handyman,Gijs
This changes CommonDialog to allow having a button 1 (which is styled like Cancel) without a button 0. (which is styled like OK) Differential Revision: https://phabricator.services.mozilla.com/D200728
1 parent 5d219a2 commit 05e3016

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

browser/components/contentanalysis/content/ContentAnalysis.sys.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,7 @@ export const ContentAnalysis = {
497497
}),
498498
Ci.nsIPromptService.BUTTON_POS_0 *
499499
Ci.nsIPromptService.BUTTON_TITLE_CANCEL +
500+
Ci.nsIPromptService.BUTTON_POS_1_DEFAULT +
500501
Ci.nsIPromptService.SHOW_SPINNER,
501502
null,
502503
null,

toolkit/components/prompts/src/CommonDialog.sys.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,18 @@ CommonDialog.prototype = {
142142
// This assumes that button0 defaults to a visible "ok" button, and
143143
// button1 defaults to a visible "cancel" button. The other 2 buttons
144144
// have no default labels (and are hidden).
145+
this.ui.button3.disabled = true;
146+
this.ui.button2.disabled = true;
145147
switch (this.numButtons) {
146148
case 4:
147149
this.setLabelForNode(this.ui.button3, this.args.button3Label);
148150
this.ui.button3.hidden = false;
151+
this.ui.button3.disabled = false;
149152
// fall through
150153
case 3:
151154
this.setLabelForNode(this.ui.button2, this.args.button2Label);
152155
this.ui.button2.hidden = false;
156+
this.ui.button2.disabled = false;
153157
// fall through
154158
case 2:
155159
// Defaults to a visible "cancel" button
@@ -160,6 +164,7 @@ CommonDialog.prototype = {
160164

161165
case 1:
162166
this.ui.button1.hidden = true;
167+
this.ui.button1.disabled = true;
163168
break;
164169
}
165170
// Defaults to a visible "ok" button

0 commit comments

Comments
 (0)