Bug 179050 Reuse <textbox type="timed"> in addressbook r=varga sr=mscott

This commit is contained in:
neil%parkwaycc.co.uk 2005-11-21 14:11:54 +00:00
Родитель 047163341e
Коммит 70942413d7
4 изменённых файлов: 12 добавлений и 41 удалений

Просмотреть файл

@ -925,47 +925,15 @@ function GetSelectedDirectory()
}
}
function onAbSearchKeyPress(event)
{
// 13 == return
if (event && event.keyCode == 13)
onAbSearchInput(true);
}
function onAbSearchInput(returnKeyHit)
{
SearchInputChanged();
if (gSearchTimer) {
clearTimeout(gSearchTimer);
gSearchTimer = null;
}
if (returnKeyHit) {
gSearchInput.select();
onEnterInSearchBar();
}
else {
gSearchTimer = setTimeout("onEnterInSearchBar();", 800);
}
}
function SearchInputChanged()
{
var clearButton = document.getElementById("clear");
if (clearButton) {
if (gSearchInput.value && (gSearchInput.value != ""))
clearButton.removeAttribute("disabled");
else
clearButton.setAttribute("disabled", "true");
}
gSearchInput.nextSibling.disabled = !gSearchInput.value;
}
function onAbClearSearch()
{
if (gSearchInput)
gSearchInput.value =""; //on input does not get fired for some reason
onAbSearchInput(true);
gSearchInput.value = "";
onEnterInSearchBar();
}
function AbSwapFirstNameLastName()

Просмотреть файл

@ -98,8 +98,9 @@
</menulist>
<label value="&for.label;" accesskey="&for.accesskey;" control="searchInput"/>
<textbox id="searchInput" flex="1"
oninput="onAbSearchInput(false);"
onkeypress="onAbSearchKeyPress(event);"/>
type="timed" timeout="800"
oninput="SearchInputChanged();"
oncommand="onEnterInSearchBar();"/>
<button id="clear" label="&clearButton.label;" disabled="true" accesskey="&clearButton.accesskey;" oncommand="onAbClearSearch();"/>
</hbox>

Просмотреть файл

@ -108,8 +108,8 @@
<hbox align="center">
<label value="&for.label;"/>
<textbox id="searchInput" flex="1"
oninput="onAbSearchInput(false);"
onkeypress="onAbSearchKeyPress(event);"/>
type="timed" timeout="800"
oncommand="onEnterInSearchBar();"/>
</hbox>
<tree id="abResultsTree" flex="1" context="composeMail" onclick="AbResultsPaneOnClick(event);" class="plain"

Просмотреть файл

@ -428,8 +428,10 @@
accesskey="&SearchNameOrEmail.accesskey;"
control="searchInput"/>
<textbox id="searchInput" flex="1"
oninput="onAbSearchInput(false);"
onkeypress="onAbSearchKeyPress(event);"
type="timed" timeout="800"
oninput="SearchInputChanged();"
oncommand="onEnterInSearchBar();"
onkeypress="if (event.keyCode == KeyEvent.DOM_VK_RETURN) this.select();"
onfocus="this.select();" onclick="this.select();"/>
<button id="clear" label="&clearButton.label;" disabled="true"
accesskey="&clearButton.accesskey;"