зеркало из https://github.com/mozilla/pjs.git
112999 - Built-in Accept button closes dialog even when not used in dialog, r=cmanske, sr=hyatt
This commit is contained in:
Родитель
524e1f8507
Коммит
c18af84d36
|
@ -18,7 +18,7 @@
|
|||
|
||||
<xul:hbox class="dialog-button-box" pack="end"
|
||||
inherits="pack=buttonpack,align=buttonalign,dir=buttondir,orient=buttonorient">
|
||||
<xul:button dlgtype="accept" class="dialog-button" default="true"/>
|
||||
<xul:button dlgtype="accept" class="dialog-button"/>
|
||||
<xul:button dlgtype="cancel" class="dialog-button"/>
|
||||
<xul:button dlgtype="help" class="dialog-button"/>
|
||||
<xul:button dlgtype="disclosure" class="dialog-button"/>
|
||||
|
@ -156,10 +156,15 @@
|
|||
for (var dlgtype in shown) {
|
||||
var anonBtn = document.getAnonymousElementByAttribute(this, "dlgtype", dlgtype);
|
||||
if (anonBtn) {
|
||||
if (this._useAnonButton[dlgtype] && shown[dlgtype])
|
||||
if (this._useAnonButton[dlgtype] && shown[dlgtype]) {
|
||||
anonBtn.removeAttribute("hidden");
|
||||
else
|
||||
if (dlgtype == "accept")
|
||||
anonBtn.setAttribute("default", "true");
|
||||
} else {
|
||||
anonBtn.setAttribute("hidden", "true");
|
||||
if (dlgtype == "accept")
|
||||
anonBtn.removeAttribute("default");
|
||||
}
|
||||
}
|
||||
}
|
||||
]]>
|
||||
|
|
Загрузка…
Ссылка в новой задаче