зеркало из https://github.com/mozilla/pjs.git
Fix bug 193835: Missing focus when selected the related checkbox or radiobox in Preference window. p=jessie.li@sun.com,r=neil@parkwaycc.co.uk,sr=jag.
This commit is contained in:
Родитель
3afad84b97
Коммит
4616483b67
|
@ -38,16 +38,16 @@
|
|||
var _elementIDs = ["advancedJavaAllow", "advancedMailFTP", "advancedMailFTPAddress"];
|
||||
|
||||
function Startup() {
|
||||
ftpCheck();
|
||||
ftpCheck(false);
|
||||
turboCheck();
|
||||
}
|
||||
|
||||
function ftpCheck() {
|
||||
function ftpCheck(setFocus) {
|
||||
var checked = document.getElementById("advancedMailFTP").checked;
|
||||
var field = document.getElementById("advancedMailFTPAddress");
|
||||
field.disabled = !checked;
|
||||
|
||||
if (! field.disabled)
|
||||
if (!field.disabled && setFocus)
|
||||
field.focus();
|
||||
}
|
||||
|
||||
|
@ -145,7 +145,7 @@
|
|||
<vbox align="start">
|
||||
<checkbox id="advancedMailFTP" label="&sendAddFtpCheck.label;" accesskey="&sendAddFtpCheck.accesskey;"
|
||||
prefstring="advanced.mailftp"
|
||||
oncommand="ftpCheck();"/>
|
||||
oncommand="ftpCheck(true);"/>
|
||||
</vbox>
|
||||
<hbox class="indent">
|
||||
<textbox id="advancedMailFTPAddress"
|
||||
|
|
|
@ -69,7 +69,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
function enableField(aCheckbox, aNodeID)
|
||||
function enableField(aCheckbox, aNodeID, setFocus)
|
||||
{
|
||||
var el = document.getElementById(aNodeID);
|
||||
if (aCheckbox.checked)
|
||||
|
@ -77,7 +77,7 @@
|
|||
else
|
||||
el.removeAttribute("disabled");
|
||||
|
||||
if (!el.disabled)
|
||||
if (!el.disabled && setFocus)
|
||||
el.focus();
|
||||
}
|
||||
|
||||
|
@ -123,7 +123,7 @@
|
|||
</hbox>
|
||||
<checkbox id="mousewheelWithNoKeySysNumlines" label="&useSystemDefault.label;" accesskey="&useSystemDefault.accesskey;"
|
||||
prefstring="mousewheel.withnokey.sysnumlines"
|
||||
oncommand="enableField(this, 'mousewheelWithNoKeyNumlines');"/>
|
||||
oncommand="enableField(this, 'mousewheelWithNoKeyNumlines', true);"/>
|
||||
</vbox>
|
||||
</hbox>
|
||||
<radio value="1" label="&scrollPgUpPgDn.label;" accesskey="&scrollPgUpPgDn.accesskey;"/>
|
||||
|
@ -144,7 +144,7 @@
|
|||
</hbox>
|
||||
<checkbox id="mousewheelWithAltKeySysNumlines" label="&useSystemDefault.label;" accesskey="&useSystemDefault.accesskey;"
|
||||
prefstring="mousewheel.withaltkey.sysnumlines"
|
||||
oncommand="enableField(this, 'mousewheelWithAltKeyNumlines');"/>
|
||||
oncommand="enableField(this, 'mousewheelWithAltKeyNumlines', true);"/>
|
||||
</vbox>
|
||||
</hbox>
|
||||
<radio value="1" label="&scrollPgUpPgDn.label;" accesskey="&scrollPgUpPgDn.accesskey;"/>
|
||||
|
@ -165,7 +165,7 @@
|
|||
</hbox>
|
||||
<checkbox id="mousewheelWithCtrlKeySysNumlines" label="&useSystemDefault.label;" accesskey="&useSystemDefault.accesskey;"
|
||||
prefstring="mousewheel.withcontrolkey.sysnumlines"
|
||||
oncommand="enableField(this, 'mousewheelWithCtrlKeyNumlines');"/>
|
||||
oncommand="enableField(this, 'mousewheelWithCtrlKeyNumlines', true);"/>
|
||||
</vbox>
|
||||
</hbox>
|
||||
<radio value="1" label="&scrollPgUpPgDn.label;" accesskey="&scrollPgUpPgDn.accesskey;"/>
|
||||
|
@ -185,7 +185,7 @@
|
|||
</hbox>
|
||||
<checkbox id="mousewheelWithShiftKeySysNumlines" label="&useSystemDefault.label;" accesskey="&useSystemDefault.accesskey;"
|
||||
prefstring="mousewheel.withshiftkey.sysnumlines"
|
||||
oncommand="enableField(this, 'mousewheelWithShiftKeyNumlines');"/>
|
||||
oncommand="enableField(this, 'mousewheelWithShiftKeyNumlines', true);"/>
|
||||
</vbox>
|
||||
</hbox>
|
||||
<radio value="1" label="&scrollPgUpPgDn.label;" accesskey="&scrollPgUpPgDn.accesskey;"/>
|
||||
|
|
|
@ -38,15 +38,14 @@
|
|||
<script type="application/x-javascript">
|
||||
<![CDATA[
|
||||
var _elementIDs = ["offlineStartupstate", "whengoingOnlinestate", "whengoingOfflinestate", "offlineCompactFolder", "offlineCompactFolderMin"];
|
||||
]]>
|
||||
|
||||
function Startup()
|
||||
{
|
||||
var aCheckbox = document.getElementById("offlineCompactFolder");
|
||||
enableField(aCheckbox, "offlineCompactFolderMin");
|
||||
enableField(aCheckbox, "offlineCompactFolderMin", false);
|
||||
}
|
||||
|
||||
function enableField(aCheckbox, aNodeID)
|
||||
function enableField(aCheckbox, aNodeID, setFocus)
|
||||
{
|
||||
var aField = document.getElementById(aNodeID);
|
||||
if (aCheckbox.checked)
|
||||
|
@ -54,10 +53,10 @@
|
|||
else
|
||||
aField.setAttribute("disabled", "true");
|
||||
|
||||
if (! aField.disabled)
|
||||
if (!aField.disabled && setFocus)
|
||||
aField.focus();
|
||||
}
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<groupbox>
|
||||
|
@ -96,7 +95,7 @@
|
|||
<hbox align="center">
|
||||
<checkbox id="offlineCompactFolder" label="&offlineCompact.label;" accesskey="&offlineCompact.accesskey;"
|
||||
prefstring="mail.prompt_purge_threshhold"
|
||||
oncommand="enableField(this,'offlineCompactFolderMin');"/>
|
||||
oncommand="enableField(this,'offlineCompactFolderMin',true);"/>
|
||||
<textbox id="offlineCompactFolderMin" size="5" value="100"
|
||||
preftype="int" prefstring="mail.purge_threshhold"/>
|
||||
<label value="&kb.label;"/>
|
||||
|
|
Загрузка…
Ссылка в новой задаче