Bug 1262262 - Add event about closing compose window. r=mkmelin, r=IanN, a=IanN
authoraceman <acelists@atlas.sk>
Sun, 24 Apr 2016 19:10:25 +0200
changeset 24848 dfbfdf30f1ca8e96d18b075938bd7ce27bab0481
parent 24847 add0942a7176658e01e6e529e0a4e196c6ca73dc
child 24849 d0f24d25360654b65343ed6feffebae05d3e0d9e
push id1657
push userclokep@gmail.com
push dateMon, 06 Jun 2016 19:50:21 +0000
treeherdercomm-beta@9fac989284b5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkmelin, IanN, IanN
bugs1262262
Bug 1262262 - Add event about closing compose window. r=mkmelin, r=IanN, a=IanN
mail/components/compose/content/MsgComposeCommands.js
suite/mailnews/compose/MsgComposeCommands.js
--- a/mail/components/compose/content/MsgComposeCommands.js
+++ b/mail/components/compose/content/MsgComposeCommands.js
@@ -2531,16 +2531,20 @@ function ComposeLoad()
   var toolbarset = document.getElementById('customToolbars');
   toolbox.toolbarset = toolbarset;
 
   awInitializeNumberOfRowsShown();
 }
 
 function ComposeUnload()
 {
+  // Send notification that the window is going away completely.
+  document.getElementById("msgcomposeWindow").dispatchEvent(
+    new Event("compose-window-unload", { bubbles: false, cancelable: false }));
+
   UnloadCommandUpdateHandlers();
 
   // Stop gSpellChecker so personal dictionary is saved
   enableInlineSpellCheck(false);
 
   EditorCleanup();
 
   if (gMsgCompose)
--- a/suite/mailnews/compose/MsgComposeCommands.js
+++ b/suite/mailnews/compose/MsgComposeCommands.js
@@ -1173,16 +1173,20 @@ function ComposeLoad()
   var mailToolbox = getMailToolbox();
   mailToolbox.customizeInit = MailToolboxCustomizeInit;
   mailToolbox.customizeDone = MailToolboxCustomizeDone;
   mailToolbox.customizeChange = MailToolboxCustomizeChange;
 }
 
 function ComposeUnload()
 {
+  // Send notification that the window is going away completely.
+  document.getElementById("msgcomposeWindow").dispatchEvent(
+    new Event("compose-window-unload", { bubbles: false, cancelable: false }));
+
   UnloadCommandUpdateHandlers();
 
   // Stop InlineSpellCheckerUI so personal dictionary is saved
   EnableInlineSpellCheck(false);
 
   EditorCleanup();
 
   RemoveMessageComposeOfflineQuitObserver();