зеркало из https://github.com/mozilla/gecko-dev.git
Fix for initial focus problems with dialog binding, bug #103739, r=aaronl, sr=shaver
This commit is contained in:
Родитель
9b47038607
Коммит
536f8d1d00
|
@ -67,14 +67,16 @@
|
||||||
this._configureButtons(this.getAttribute("buttons"));
|
this._configureButtons(this.getAttribute("buttons"));
|
||||||
|
|
||||||
// give focus to the first focusable element in the dialog
|
// give focus to the first focusable element in the dialog
|
||||||
this.addEventListener("load", this.setInitialFocus, true);
|
window.addEventListener("load", this.setInitialFocus, false);
|
||||||
]]>
|
]]>
|
||||||
</constructor>
|
</constructor>
|
||||||
|
|
||||||
<method name="setInitialFocus">
|
<method name="setInitialFocus">
|
||||||
|
<parameter name="event"/>
|
||||||
<body>
|
<body>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
document.commandDispatcher.advanceFocusIntoSubtree(this);
|
if (!document.commandDispatcher.focusedElement)
|
||||||
|
document.commandDispatcher.advanceFocusIntoSubtree(document.documentElement);
|
||||||
]]>
|
]]>
|
||||||
</body>
|
</body>
|
||||||
</method>
|
</method>
|
||||||
|
|
|
@ -1,57 +1,11 @@
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
|
|
||||||
|
|
||||||
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
|
|
||||||
<!DOCTYPE window SYSTEM "chrome://global/locale/commonDialog.dtd">
|
|
||||||
|
|
||||||
<window id="commonDialog"
|
<window id="commonDialog"
|
||||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||||
orient="vertical"
|
|
||||||
onload="commonDialogOnLoad();"
|
|
||||||
style="min-width: 29em; min-height: 8.5em; -moz-user-focus: ignore;"
|
|
||||||
class="dialog">
|
class="dialog">
|
||||||
|
|
||||||
<script type="application/x-javascript" src="chrome://global/content/commonDialog.js"/>
|
|
||||||
|
|
||||||
<keyset id="dialogKeys"/>
|
|
||||||
|
|
||||||
<hbox flex="1">
|
|
||||||
<hbox align="start">
|
|
||||||
<image id="info.icon" class="spaced"/>
|
|
||||||
</hbox>
|
|
||||||
<separator orient="vertical" class="thin"/>
|
|
||||||
<vbox flex="1">
|
|
||||||
<!-- text -->
|
|
||||||
<html id="info.header" class="header" flex="1"/>
|
|
||||||
<vbox id="info.box" flex="1" style="max-width: 45em;"/>
|
|
||||||
|
|
||||||
<!-- edit fields -->
|
|
||||||
<vbox id="loginEditField" collapsed="true">
|
|
||||||
<text class="label" id="login.text" value="&editfield0.label;" for="dialog.loginname"/>
|
|
||||||
<textbox tabindex="0" id="dialog.loginname" flex="1"/>
|
|
||||||
<separator class="thin"/>
|
|
||||||
</vbox>
|
|
||||||
<vbox id ="password1EditField" collapsed="true">
|
|
||||||
<text class="label" id="password1.text" value="&editfield1.label;" for="dialog.password1"/>
|
|
||||||
<textbox tabindex="1" type="password" id="dialog.password1" flex="1"/>
|
|
||||||
<separator class="thin"/>
|
|
||||||
</vbox>
|
|
||||||
<vbox id="password2EditField" collapsed="true">
|
|
||||||
<text class="label" id="password2.text" value="&editfield2.label;" for="dialog.password2"/>
|
|
||||||
<textbox tabindex="1" type="password" id="dialog.password2" flex="1"/>
|
|
||||||
<separator class="thin"/>
|
|
||||||
</vbox>
|
|
||||||
|
|
||||||
<spacer flex="1"/>
|
|
||||||
|
|
||||||
<!-- checkbox -->
|
<!-- checkbox -->
|
||||||
<hbox id="checkboxContainer" collapsed="true" align="middle">
|
<checkbox label="Hello world!"/>
|
||||||
<checkbox id="checkbox" oncommand="onCheckboxClick(this);" style="max-width: 40em;"/>
|
|
||||||
</hbox>
|
|
||||||
</vbox>
|
|
||||||
</hbox>
|
|
||||||
|
|
||||||
<separator class="thin"/>
|
|
||||||
<hbox id="okCancelButtons"/>
|
|
||||||
|
|
||||||
</window>
|
</window>
|
||||||
|
|
Загрузка…
Ссылка в новой задаче