mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-01 17:23:59 +00:00
Bug 290024 Address Book vanishes if it is renamed as blank
p=bugzilla@standard8.demon.co.uk r=neil.parkwaycc.co.uk sr=bienvenu a=chofmann
This commit is contained in:
parent
470df97578
commit
17b8ae80ba
@ -1,11 +1,15 @@
|
||||
|
||||
var okCallback = 0;
|
||||
var gCanRename = true;
|
||||
var gOkButton;
|
||||
var gNameInput;
|
||||
|
||||
function abNameOnLoad()
|
||||
{
|
||||
var abName = "";
|
||||
|
||||
gOkButton = document.documentElement.getButton('accept');
|
||||
|
||||
// look in arguments[0] for parameters
|
||||
if ("arguments" in window && window.arguments[0])
|
||||
{
|
||||
@ -23,25 +27,31 @@ function abNameOnLoad()
|
||||
}
|
||||
|
||||
// focus on input
|
||||
var name = document.getElementById('name');
|
||||
if (name) {
|
||||
gNameInput = document.getElementById('name');
|
||||
if (gNameInput) {
|
||||
if (abName)
|
||||
name.value = abName;
|
||||
gNameInput.value = abName;
|
||||
|
||||
if (gCanRename)
|
||||
name.focus();
|
||||
gNameInput.focus();
|
||||
else
|
||||
name.disabled = true;
|
||||
gNameInput.disabled = true;
|
||||
}
|
||||
|
||||
abNameDoOkEnabling()
|
||||
|
||||
moveToAlertPosition();
|
||||
}
|
||||
|
||||
function abNameOKButton()
|
||||
{
|
||||
if (top.okCallback && gCanRename)
|
||||
top.okCallback(document.getElementById('name').value);
|
||||
top.okCallback(gNameInput.value.replace(/^\s+|\s+$/g, ''));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function abNameDoOkEnabling()
|
||||
{
|
||||
gOkButton.disabled = !/\S/.test(gNameInput.value);
|
||||
}
|
||||
|
@ -50,7 +50,7 @@
|
||||
|
||||
<hbox align="center">
|
||||
<label control="name" value="&name.label;"/>
|
||||
<textbox tabindex="0" id="name"/>
|
||||
<textbox tabindex="0" oninput="abNameDoOkEnabling();" id="name"/>
|
||||
</hbox>
|
||||
</dialog>
|
||||
|
||||
|
@ -1,10 +1,14 @@
|
||||
var okCallback = 0;
|
||||
var gCanRename = true;
|
||||
var gOkButton;
|
||||
var gNameInput;
|
||||
|
||||
function abNameOnLoad()
|
||||
{
|
||||
var abName = "";
|
||||
|
||||
gOkButton = document.documentElement.getButton('accept');
|
||||
|
||||
// look in arguments[0] for parameters
|
||||
if ("arguments" in window && window.arguments[0])
|
||||
{
|
||||
@ -22,24 +26,31 @@ function abNameOnLoad()
|
||||
}
|
||||
|
||||
// focus on input
|
||||
var name = document.getElementById('name');
|
||||
if (name) {
|
||||
gNameInput = document.getElementById('name');
|
||||
if (gNameInput) {
|
||||
if (abName)
|
||||
name.value = abName;
|
||||
gNameInput.value = abName;
|
||||
|
||||
if (gCanRename)
|
||||
name.focus();
|
||||
gNameInput.focus();
|
||||
else
|
||||
name.disabled = true;
|
||||
gNameInput.disabled = true;
|
||||
}
|
||||
|
||||
abNameDoOkEnabling()
|
||||
|
||||
moveToAlertPosition();
|
||||
}
|
||||
|
||||
function abNameOKButton()
|
||||
{
|
||||
if (top.okCallback && gCanRename)
|
||||
top.okCallback(document.getElementById('name').value);
|
||||
top.okCallback(gNameInput.value.replace(/^\s+|\s+$/g, ''));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function abNameDoOkEnabling()
|
||||
{
|
||||
gOkButton.disabled = !/\S/.test(gNameInput.value);
|
||||
}
|
||||
|
@ -50,6 +50,6 @@
|
||||
|
||||
<hbox align="center">
|
||||
<label control="name" value="&name.label;" accesskey="&name.accesskey;"/>
|
||||
<textbox id="name" flex="1"/>
|
||||
<textbox id="name" oninput="abNameDoOkEnabling();" flex="1"/>
|
||||
</hbox>
|
||||
</dialog>
|
||||
|
Loading…
Reference in New Issue
Block a user