diff --git a/mozilla/mailnews/base/resources/content/mailWidgets.xml b/mozilla/mailnews/base/resources/content/mailWidgets.xml index 4949708d8ae..5fc62a33502 100644 --- a/mozilla/mailnews/base/resources/content/mailWidgets.xml +++ b/mozilla/mailnews/base/resources/content/mailWidgets.xml @@ -400,7 +400,7 @@ diff --git a/mozilla/mailnews/base/search/resources/content/FilterEditor.js b/mozilla/mailnews/base/search/resources/content/FilterEditor.js index ec757083877..3494a188de7 100644 --- a/mozilla/mailnews/base/search/resources/content/FilterEditor.js +++ b/mozilla/mailnews/base/search/resources/content/FilterEditor.js @@ -64,6 +64,11 @@ function filterEditorOnLoad() moveToAlertPosition(); } +function onEnterInSearchTerm() +{ + // do nothing. okOk() will get called since this is a dialog +} + function onOk() { if (isDuplicateFilterNameExists()) diff --git a/mozilla/mailnews/base/search/resources/content/SearchDialog.js b/mozilla/mailnews/base/search/resources/content/SearchDialog.js index 0b787bd3f35..1b9e437c2b3 100644 --- a/mozilla/mailnews/base/search/resources/content/SearchDialog.js +++ b/mozilla/mailnews/base/search/resources/content/SearchDialog.js @@ -46,7 +46,7 @@ var gNextMessageViewIndexAfterDelete = -1; var gDataSourceSearchListener; var gViewSearchListener; -var gButton; +var gSearchStopButton; var gSearchSessionFolderListener; var gMailSession; @@ -109,7 +109,7 @@ var gSearchNotificationListener = onSearchDone: function(status) { - gButton.setAttribute("label", gSearchBundle.getString("labelForSearchButton")); + gSearchStopButton.setAttribute("label", gSearchBundle.getString("labelForSearchButton")); var statusMsg; // if there are no hits, it means no matches were found in the search. @@ -133,7 +133,7 @@ var gSearchNotificationListener = onNewSearch: function() { - gButton.setAttribute("label", gSearchBundle.getString("labelForStopButton")); + gSearchStopButton.setAttribute("label", gSearchBundle.getString("labelForStopButton")); // if (gThreadTree) // gThreadTree.clearItemSelection(); @@ -227,7 +227,7 @@ function initializeSearchWindowWidgets() { gFolderPicker = document.getElementById("searchableFolders"); // gThreadTree = document.getElementById("threadTree"); - gButton = document.getElementById("search-button"); + gSearchStopButton = document.getElementById("search-button"); gStatusBar = document.getElementById('statusbar-icon'); msgWindow = Components.classes[msgWindowContractID].createInstance(nsIMsgWindow); @@ -298,6 +298,20 @@ function onChooseFolder(event) { } } +function onEnterInSearchTerm() +{ + // on enter + // if not searching, start the search + // if searching, stop and then start again + if (gSearchStopButton.getAttribute("label") == gSearchBundle.getString("labelForSearchButton")) { + onSearch(); + } + else { + onSearchStop(); + onSearch(); + } +} + function onSearch() { // set the view. do this on every search, to