mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 07:15:46 +00:00
106131 - hitting enter on focused OK button in dialog fires onaccept 2x, r=blake, sr=hyatt
This commit is contained in:
parent
a08c6cb2e7
commit
120df3dd71
@ -199,14 +199,11 @@
|
||||
<method name="_hitEnter">
|
||||
<body>
|
||||
<![CDATA[
|
||||
// if a button is focused, dispatch its command instead
|
||||
// of accepting the dialog
|
||||
// if a dialog button is focused, do nothing, since its oncommand
|
||||
// will fire, causing the _doButtonCommand to be called naturally
|
||||
var focused = document.commandDispatcher.focusedElement;
|
||||
if (focused.localName == "button") {
|
||||
if (focused.hasAttribute("dlgtype"))
|
||||
this._doButtonCommand(focused.getAttribute("dlgtype"));
|
||||
if (focused && focused.localName == "button" && focused.hasAttribute("dlgtype"))
|
||||
return;
|
||||
}
|
||||
|
||||
// only accept dialog if accept button is the default
|
||||
var btn = this.getButton("accept");
|
||||
|
Loading…
Reference in New Issue
Block a user