Bug 120527 Dialog fix to make default button not appear default while another button has focus r=aaronlev,mano,mconnor sr=jag

This commit is contained in:
neil%parkwaycc.co.uk 2005-09-20 16:22:39 +00:00
parent 48cad43b58
commit 6dab407a52
2 changed files with 11 additions and 0 deletions

View File

@ -401,6 +401,12 @@
</handler>
#ifdef XP_MACOSX
<handler event="keypress" key="." modifiers="meta" phase="capturing" action="this.cancelDialog();"/>
#else
<handler event="focus" phase="capturing">
var btn = this.getButton(this.defaultButton);
if (btn)
btn.setAttribute("default", event.originalTarget == btn || !(event.originalTarget instanceof Components.interfaces.nsIDOMXULButtonElement));
</handler>
#endif
</handlers>

View File

@ -343,6 +343,11 @@
if (!event.getPreventDefault())
this.cancelDialog();
</handler>
<handler event="focus" phase="capturing">
var btn = this.getButton(this.defaultButton);
if (btn && !/Mac/.test(navigator.platform))
btn.setAttribute("default", event.originalTarget == btn || !(event.originalTarget instanceof Components.interfaces.nsIDOMXULButtonElement));
</handler>
</handlers>
</binding>