mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 06:11:37 +00:00
107029 r=racham sr=mscott. Add Clear button to come out of quick search (mail - 3pane)
This commit is contained in:
parent
0239f242fc
commit
927c076d8a
@ -286,9 +286,11 @@ function RerootFolder(uri, newFolder, viewType, viewFlags, sortType, sortOrder)
|
||||
CreateDBView(newFolder, viewType, viewFlags, sortType, sortOrder);
|
||||
if (oldFolder)
|
||||
{
|
||||
/*disable quick search clear button if we were in the search view on folder switching*/
|
||||
disableQuickSearchClearButton();
|
||||
|
||||
/*we don't null out the db reference for inbox because inbox is like the "main" folder
|
||||
and performance outweighs footprint */
|
||||
|
||||
if (!IsSpecialFolder(oldFolder, MSG_FOLDER_FLAG_INBOX))
|
||||
if (oldFolder.URI != newFolder.URI)
|
||||
oldFolder.setMsgDatabase(null);
|
||||
|
@ -1487,6 +1487,7 @@ Rights Reserved.
|
||||
<hbox id="searchBox" persist="collapsed" align="center">
|
||||
<label id="searchCriteria" value="&SearchSubjectOrSender.label;"/>
|
||||
<textbox id="searchInput" flex="1" oninput="onSearchInput(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>
|
||||
|
||||
|
@ -908,9 +908,7 @@ function FolderPaneOnClick(event)
|
||||
}
|
||||
else if (gDBView && gDBView.isSearchView)
|
||||
{
|
||||
if (gSearchInput) gSearchInput.value =""; //on input does not get fired for some reason
|
||||
onSearchInput(null);
|
||||
SetFocusThreadPane();
|
||||
onClearSearch();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -33,6 +33,7 @@ var gStatusBar = null;
|
||||
var gSearchInProgress = false;
|
||||
var gSearchCriteria = null;
|
||||
var gSearchInput = null;
|
||||
var gClearButton = null;
|
||||
|
||||
// nsIMsgSearchNotify object
|
||||
var gSearchNotificationListener =
|
||||
@ -81,6 +82,7 @@ function getDocumentElements()
|
||||
gStatusBar = document.getElementById('statusbar-icon');
|
||||
gSearchInput = document.getElementById('searchInput');
|
||||
gSearchCriteria =document.getElementById('searchCriteria');
|
||||
gClearButton = document.getElementById('clearButton');
|
||||
}
|
||||
|
||||
function addListeners()
|
||||
@ -115,16 +117,21 @@ function onEnterInSearchBar()
|
||||
}
|
||||
removeListeners();
|
||||
}
|
||||
|
||||
if (gSearchInput.value == "")
|
||||
{
|
||||
var searchView = gDBView.isSearchView;
|
||||
if (searchView)
|
||||
{
|
||||
statusFeedback.showStatusString("");
|
||||
disableQuickSearchClearButton();
|
||||
gDBView.reloadFolderAfterQuickSearch(); // that should have initialized gDBView
|
||||
}
|
||||
return;
|
||||
}
|
||||
else
|
||||
gClearButton.setAttribute("disabled", false); //coming into search enable clear button
|
||||
|
||||
|
||||
ClearThreadPaneSelection();
|
||||
ClearMessagePane();
|
||||
@ -215,3 +222,15 @@ function onSearchInput(event)
|
||||
}
|
||||
}
|
||||
|
||||
function onClearSearch()
|
||||
{
|
||||
if (gSearchInput)
|
||||
gSearchInput.value =""; //on input does not get fired for some reason
|
||||
onSearchInput(null);
|
||||
}
|
||||
|
||||
function disableQuickSearchClearButton()
|
||||
{
|
||||
if (gClearButton)
|
||||
gClearButton.setAttribute("disabled", true); //going out of search disable clear button
|
||||
}
|
||||
|
@ -437,6 +437,7 @@ Rights Reserved.
|
||||
<!ENTITY menuBar.tooltip "Menu Bar">
|
||||
<!ENTITY mailToolbar.tooltip "Mail Toolbar">
|
||||
<!ENTITY advancedButton.tooltip "Search Messages...">
|
||||
<!ENTITY clearButton.tooltip "Clear the search criteria and show all messages">
|
||||
<!ENTITY getMsgButton.tooltip "Get new messages">
|
||||
<!ENTITY newMsgButton.tooltip "Create a new message">
|
||||
<!ENTITY replyButton.tooltip "Reply to the message">
|
||||
@ -533,3 +534,5 @@ Rights Reserved.
|
||||
<!ENTITY SearchSubjectOrSender.label "Subject or Sender contains:">
|
||||
<!ENTITY SearchNameOrEmail.label "Name or Email contains:">
|
||||
<!ENTITY advancedButton.label "Advanced...">
|
||||
<!ENTITY clearButton.label "Clear">
|
||||
<!ENTITY clearButton.accesskey "C">
|
||||
|
Loading…
Reference in New Issue
Block a user