fix for #128500. don't select the quick search text when the timer fires.

r=sspitzer, sr=bienvenu, a=shaver.  fix by naving, who is on vacation.
This commit is contained in:
sspitzer%netscape.com 2002-03-13 01:21:39 +00:00
Родитель da504ca360
Коммит 1e02b1d9af
2 изменённых файлов: 13 добавлений и 6 удалений

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

@ -1492,7 +1492,7 @@ Rights Reserved.
<hbox id="searchBox" persist="collapsed" align="center">
<label id="searchCriteria" value="&SearchSubjectOrSender.label;"/>
<textbox id="searchInput" flex="1" onfocus="this.select();" oninput="onSearchInput(event);"/>
<textbox id="searchInput" flex="1" onfocus="this.select();" oninput="onSearchInput(false);" onkeypress="onSearchKeyPress(event);"/>
<button id="clearButton" label="&clearButton.label;" disabled="true" tooltiptext="&clearButton.tooltip;" oncommand="onClearSearch();" accesskey="&clearButton.accesskey;"/>
<button id="advancedButton" label="&advancedButton.label;" tooltiptext="&advancedButton.tooltip;" oncommand="onAdvancedSearch();"/>
</hbox>

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

@ -130,10 +130,7 @@ function onEnterInSearchBar()
return;
}
else
{
gSearchInput.select();
gClearButton.setAttribute("disabled", false); //coming into search enable clear button
}
ClearThreadPaneSelection();
ClearMessagePane();
@ -210,14 +207,24 @@ function onSearchStop()
gSearchSession.interruptSearch();
}
function onSearchInput(event)
function onSearchKeyPress(event)
{
// 13 == return
if (event && event.keyCode == 13)
onSearchInput(true);
}
function onSearchInput(returnKeyHit)
{
if (gSearchTimer) {
clearTimeout(gSearchTimer);
gSearchTimer = null;
}
if (event && event.keyCode == 13) {
// only select the text when the return key was hit
if (returnKeyHit) {
GetSearchInput();
gSearchInput.select();
onEnterInSearchBar();
}
else {