diff --git a/mail/base/content/SearchDialog.js b/mail/base/content/SearchDialog.js
index 277d88d4dd..49786d7f37 100644
--- a/mail/base/content/SearchDialog.js
+++ b/mail/base/content/SearchDialog.js
@@ -17,6 +17,9 @@ var { PluralForm } = ChromeUtils.importESModule(
);
var { TagUtils } = ChromeUtils.import("resource:///modules/TagUtils.jsm");
+var messenger;
+var msgWindow;
+
var gCurrentFolder;
var gFolderDisplay;
diff --git a/mail/base/content/SearchDialog.xhtml b/mail/base/content/SearchDialog.xhtml
index fba5f35ac2..69b97bf431 100644
--- a/mail/base/content/SearchDialog.xhtml
+++ b/mail/base/content/SearchDialog.xhtml
@@ -37,6 +37,7 @@
+
diff --git a/mail/base/content/about3Pane.js b/mail/base/content/about3Pane.js
index dea65cf703..b5fe5edd71 100644
--- a/mail/base/content/about3Pane.js
+++ b/mail/base/content/about3Pane.js
@@ -664,7 +664,7 @@ var folderPaneContextMenu = {
topChromeWindow.MsgOpenNewWindowForFolder(gFolder.URI, -1);
break;
case "folderPaneContext-searchMessages":
- topChromeWindow.gFolderTreeController.searchMessages(gFolder);
+ commandController.doCommand("cmd_searchMessages");
break;
case "folderPaneContext-subscribe":
topChromeWindow.MsgSubscribe(gFolder);
diff --git a/mail/base/content/folderPane.js b/mail/base/content/folderPane.js
index 23fb60391a..fe82750a52 100644
--- a/mail/base/content/folderPane.js
+++ b/mail/base/content/folderPane.js
@@ -409,17 +409,6 @@ var gFolderTreeController = {
);
},
- /**
- * Opens a search window with the given folder, or the selected one if none
- * is given.
- *
- * @param [aFolder] the folder to open the search window for, if different
- * from the selected one
- */
- searchMessages(aFolder) {
- MsgSearchMessages(aFolder);
- },
-
/**
* Prompts for confirmation, if the user hasn't already chosen the "don't ask
* again" option.
diff --git a/mail/base/content/mailCommon.js b/mail/base/content/mailCommon.js
index e65ab36a84..f7c15369f1 100644
--- a/mail/base/content/mailCommon.js
+++ b/mail/base/content/mailCommon.js
@@ -286,6 +286,15 @@ var commandController = {
cmd_space() {
// TODO: Implement
},
+ cmd_searchMessages() {
+ // We always open a new search dialog for each search command.
+ top.openDialog(
+ "chrome://messenger/content/SearchDialog.xhtml",
+ "_blank",
+ "chrome,resizable,status,centerscreen,dialog=no",
+ { folder: gFolder }
+ );
+ },
},
_isCallbackEnabled: {},
@@ -464,6 +473,9 @@ var commandController = {
case "cmd_applyFilters": {
return this._getViewCommandStatus(Ci.nsMsgViewCommandType.applyFilters);
}
+ case "cmd_searchMessages": {
+ return true;
+ }
}
return false;
diff --git a/mail/base/content/mailWindowOverlay.js b/mail/base/content/mailWindowOverlay.js
index acf378a4c9..d6dac00190 100644
--- a/mail/base/content/mailWindowOverlay.js
+++ b/mail/base/content/mailWindowOverlay.js
@@ -2042,29 +2042,6 @@ function openGlodaSearchTab() {
document.getElementById("tabmail").openTab("glodaFacet");
}
-/**
- * Opens a search window with the given folder, or the displayed one if none is
- * chosen.
- *
- * @param {nsIMsgFolder} folder - The folder to open the search window for, if
- * different from the displayed one.
- */
-function MsgSearchMessages(folder) {
- // Don't trigger anything if there are no accounts configured. This is to
- // disable potential triggers via shortcuts.
- if (MailServices.accounts.accounts.length == 0) {
- return;
- }
-
- // We always open a new search dialog for each search command
- window.openDialog(
- "chrome://messenger/content/SearchDialog.xhtml",
- "_blank",
- "chrome,resizable,status,centerscreen,dialog=no",
- { folder }
- );
-}
-
function MsgSearchAddresses() {
var args = { directory: null };
OpenOrFocusWindow(
diff --git a/mail/base/content/mainCommandSet.inc.xhtml b/mail/base/content/mainCommandSet.inc.xhtml
index e5bf41b95e..4419c29a23 100644
--- a/mail/base/content/mainCommandSet.inc.xhtml
+++ b/mail/base/content/mainCommandSet.inc.xhtml
@@ -134,6 +134,7 @@
+
diff --git a/mail/base/content/mainKeySet.inc.xhtml b/mail/base/content/mainKeySet.inc.xhtml
index 0ff36c9d5a..a07d6281ee 100644
--- a/mail/base/content/mainKeySet.inc.xhtml
+++ b/mail/base/content/mainKeySet.inc.xhtml
@@ -177,8 +177,8 @@
+ modifiers="accel,shift"
+ command="cmd_searchMessages"/>
+ command="cmd_searchMessages"/>
+ command="cmd_searchMessages"/>