63728 - Per-platform behavior of Enter key when a button is focused in a dialog, r=blake, sr=hyatt

This commit is contained in:
hewitt%netscape.com 2001-10-03 03:29:17 +00:00
parent 6448d3a303
commit d1f43e0eb6

View File

@ -190,6 +190,15 @@
<method name="_hitEnter">
<body>
<![CDATA[
// if a button is focused, dispatch its command instead
// of accepting the dialog
var focused = document.commandDispatcher.focusedElement;
if (focused.localName == "button") {
if (focused.hasAttribute("dlgtype"))
this._doButtonCommand(focused.getAttribute("dlgtype"));
return;
}
// only accept dialog if accept button is the default
var btn = this.getButton("accept");
if (btn && btn.getAttribute("default") == "true")