зеркало из https://github.com/mozilla/gecko-dev.git
Bug 558202 - enter/escape keys don't work correctly in confirmEx in Fennec [r=mfinkle]
This commit is contained in:
Родитель
807c92159d
Коммит
93ac1a676d
|
@ -35,7 +35,11 @@ var PromptHelper = {
|
|||
|
||||
closeDialog : function(confirm, id) {
|
||||
let dialog = document.getElementById(id);
|
||||
dialog.arguments.result = confirm;
|
||||
if (typeof confirm == "boolean" && dialog.arguments && "defaultButton" in dialog.arguments)
|
||||
// confirmEx always returns 1 when dismissed with "escape" (bug 345067).
|
||||
dialog.arguments.result = confirm ? dialog.arguments.defaultButton : 1;
|
||||
else
|
||||
dialog.arguments.result = confirm;
|
||||
dialog.close();
|
||||
},
|
||||
|
||||
|
|
|
@ -231,10 +231,18 @@ promptService.prototype = {
|
|||
|
||||
let numButtons = 0;
|
||||
let titles = [aButton0, aButton1, aButton2];
|
||||
|
||||
let defaultButton = 0;
|
||||
if (aButtonFlags & Ci.nsIPromptService.BUTTON_POS_1_DEFAULT)
|
||||
defaultButton = 1;
|
||||
if (aButtonFlags & Ci.nsIPromptService.BUTTON_POS_2_DEFAULT)
|
||||
defaultButton = 2;
|
||||
|
||||
var params = new Object();
|
||||
params.result = false;
|
||||
params.checkbox = aCheckState;
|
||||
var params = {
|
||||
result: false,
|
||||
checkbox: aCheckState,
|
||||
defaultButton: defaultButton
|
||||
}
|
||||
|
||||
let dialog = this.openDialog(aParent, "chrome://browser/content/prompt/confirm.xul", params);
|
||||
doc.getElementById("prompt-confirm-title").value = aTitle;
|
||||
|
|
Загрузка…
Ссылка в новой задаче