Bug 1562677 - Re-initialise find toolbar's browser to work around broken find bar. r=jorgk
authorGeoff Lankow <geoff@darktrojan.net>
Thu, 04 Jul 2019 15:33:13 +1200
changeset 36025 c3b1828cbcbea1b34dc3b099560695d0376bdf06
parent 36024 f529df9e637fa488fec61e2f3567bf58683cd57f
child 36026 63cc3743efc6bfc78e9e779d459c046bb5440a71
push id392
push userclokep@gmail.com
push dateMon, 02 Sep 2019 20:17:19 +0000
reviewersjorgk
bugs1562677
Bug 1562677 - Re-initialise find toolbar's browser to work around broken find bar. r=jorgk
mail/base/content/mailTabs.js
mail/base/content/messageWindow.js
--- a/mail/base/content/mailTabs.js
+++ b/mail/base/content/mailTabs.js
@@ -74,16 +74,19 @@ var mailTabType = {
         accountCentral: true,
         message: false,
       },
       openFirstTab(aTab) {
         this.openTab(aTab, true, new MessagePaneDisplayWidget(), true);
         // persistence and restoreTab wants to know if we are the magic first tab
         aTab.firstTab = true;
         aTab.folderDisplay.makeActive();
+
+        // By reassigning this here, we fix the find bar (bug 1562677).
+        document.getElementById("FindToolbar").browser = document.getElementById("messagepane");
       },
       /**
        * @param aArgs.folder The nsIMsgFolder to display.
        * @param [aArgs.msgHdr] Optional message header to display.
        * @param [aArgs.folderPaneVisible] Whether the folder pane should be
        *            visible. If this isn't specified, the current or first tab's
        *            current state is used.
        * @param [aArgs.messagePaneVisible] Whether the message pane should be
--- a/mail/base/content/messageWindow.js
+++ b/mail/base/content/messageWindow.js
@@ -357,16 +357,19 @@ function OnLoadMessageWindow() {
 
     document.documentElement.setAttribute("width", defaultWidth);
     document.documentElement.setAttribute("height", defaultHeight);
     // Make sure we're safe at the left/top edge of screen
     document.documentElement.setAttribute("screenX", screen.availLeft);
     document.documentElement.setAttribute("screenY", screen.availTop);
   }
 
+  // By reassigning this here, we fix the find bar (bug 1562677).
+  document.getElementById("FindToolbar").browser = document.getElementById("messagepane");
+
   ToolbarIconColor.init();
   setTimeout(delayedOnLoadMessageWindow, 0); // when debugging, set this to 5000, so you can see what happens after the window comes up.
 }
 
 function delayedOnLoadMessageWindow() {
   HideMenus();
   ShowMenus();
   MailOfflineMgr.init();