Bug 880595 Unable to turn inline spellchecking back on if it was already on when the compose window was recycled r+a=Standard8
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Thu, 25 Jul 2013 21:15:10 +0100
changeset 14208 4748f12ac8a16e4245fc48a3279aae68a45ca31b
parent 14207 9b01cd6a5522d11f1bd92eb647ce5ef66841cc2b
child 14209 d4eb28c60ab571d163678a0c95c26bb2ad620f05
push id991
push userneil@parkwaycc.co.uk
push dateThu, 25 Jul 2013 20:15:16 +0000
treeherdercomm-aurora@4748f12ac8a1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs880595
Bug 880595 Unable to turn inline spellchecking back on if it was already on when the compose window was recycled r+a=Standard8 a=Standard8 for checkin to a CLOSED TREE
editor/ui/composer/content/editor.xul
mail/components/compose/content/MsgComposeCommands.js
mail/components/compose/content/messengercompose.xul
suite/mailnews/compose/MsgComposeCommands.js
suite/mailnews/compose/messengercompose.xul
--- a/editor/ui/composer/content/editor.xul
+++ b/editor/ui/composer/content/editor.xul
@@ -316,18 +316,17 @@
       <!-- KLUDGE:  Temporary fix for bug 34414:
            The current editor tag doesn't have a view, 
            which breaks deck frame-hiding mechanism 
        -->
       <stack>
         <editor editortype="html"
                 type="content-primary"
                 id="content-frame"
-                onclick="EditorClick(event);"
-                ondblclick="EditorDblClick(event);"
+                onclick="EditorClick(event); if (event.detail == 2) EditorDblClick(event);"
                 context="contentAreaContextMenu"
                 flex="1"
                 tooltip="aHTMLTooltip"/>
       </stack>
       <vbox>
         <label id="doctype-text" crop="right"/>
         <editor type="content"
                 id="content-source"
--- a/mail/components/compose/content/MsgComposeCommands.js
+++ b/mail/components/compose/content/MsgComposeCommands.js
@@ -187,16 +187,23 @@ var gComposeRecyclingListener = {
     ReleaseAutoCompleteState();
     awResetAllRows();
     RemoveAllAttachments();
 
     // We need to clear the identity popup menu in case the user will change them.
     // It will be rebuilt later in ComposeStartup
     ClearIdentityListPopup(document.getElementById("msgIdentityPopup"));
 
+    // Stop gSpellChecker so personal dictionary is saved.
+    // We need to do this before disabling the editor.
+    enableInlineSpellCheck(false);
+    // clear any suggestions in the context menu
+    gSpellChecker.clearSuggestionsFromMenu();
+    gSpellChecker.clearDictionaryListFromMenu();
+
     //Clear the subject
     GetMsgSubjectElement().value = "";
     // be sure to clear the transaction manager for the subject
     GetMsgSubjectElement().editor.transactionManager.clear();
     SetComposeWindowTitle();
 
     SetContentAndBodyAsUnmodified();
     updateEditableFields(true);
@@ -224,22 +231,16 @@ var gComposeRecyclingListener = {
         document.getElementById("FormatToolbar").hidden = false;
     }
 
     // Reset the Customize Toolbars panel/sheet if open.
     if (getMailToolbox().customizing && gCustomizeSheet)
       document.getElementById("customizeToolbarSheetIFrame")
               .contentWindow.finishToolbarCustomization();
 
-    // Stop gSpellChecker so personal dictionary is saved
-    enableInlineSpellCheck(false);
-    // clear any suggestions in the context menu
-    gSpellChecker.clearSuggestionsFromMenu();
-    gSpellChecker.clearDictionaryListFromMenu();
-
     //Reset editor
     EditorResetFontAndColorAttributes();
     EditorCleanup();
 
     //Release the nsIMsgComposeParams object
     if (window.arguments && window.arguments[0])
       window.arguments[0] = null;
     var event = document.createEvent('Events');
--- a/mail/components/compose/content/messengercompose.xul
+++ b/mail/components/compose/content/messengercompose.xul
@@ -950,17 +950,17 @@
                       oncommand="doStatefulCommand('cmd_smiley', ':-X' )"/>
           </menupopup>
         </toolbarbutton>
         <spacer flex="1"/>
       </toolbar>
     </toolbox>
 
     <editor type="content-primary" id="content-frame" src="about:blank" name="browser.message.body" flex="1"
-            ondblclick="EditorDblClick(event);"
+            onclick="if (event.detail == 2) EditorDblClick(event);"
             context="msgComposeContext"/>
   </vbox>
 
   </vbox>
   </hbox>
   <panel id="customizeToolbarSheetPopup" noautohide="true">
     <iframe id="customizeToolbarSheetIFrame"
             style="&dialog.dimensions;"
--- a/suite/mailnews/compose/MsgComposeCommands.js
+++ b/suite/mailnews/compose/MsgComposeCommands.js
@@ -159,16 +159,23 @@ var gComposeRecyclingListener = {
     //Reset recipients and attachments
     ReleaseAutoCompleteState();
     awResetAllRows();
     RemoveAllAttachments();
 
     // We need to clear the identity popup menu in case the user will change them. It will be rebuilded later in ComposeStartup
     ClearIdentityListPopup(document.getElementById("msgIdentityPopup"));
 
+    // Stop InlineSpellCheckerUI so personal dictionary is saved.
+    // We need to do this before disabling the editor.
+    EnableInlineSpellCheck(false);
+    // clear any suggestions in the context menu
+    InlineSpellCheckerUI.clearSuggestionsFromMenu();
+    InlineSpellCheckerUI.clearDictionaryListFromMenu();
+
     //Clear the subject
     GetMsgSubjectElement().value = "";
     SetComposeWindowTitle();
 
     SetContentAndBodyAsUnmodified();
     disableEditableFields();
     ReleaseGlobalVariables();
 
@@ -194,22 +201,16 @@ var gComposeRecyclingListener = {
         document.getElementById("FormatToolbar").hidden = false;
     }
 
     //Reset the Customize Toolbars panel/sheet if open.
     if (getMailToolbox().customizing && gCustomizeSheet)
       document.getElementById("customizeToolbarSheetIFrame")
               .contentWindow.finishToolbarCustomization();
 
-    // Stop InlineSpellCheckerUI so personal dictionary is saved
-    EnableInlineSpellCheck(false);
-    // clear any suggestions in the context menu
-    InlineSpellCheckerUI.clearSuggestionsFromMenu();
-    InlineSpellCheckerUI.clearDictionaryListFromMenu();
-
     //Reset editor
     EditorResetFontAndColorAttributes();
     EditorCleanup();
 
     //Release the nsIMsgComposeParams object
     if (window.arguments && window.arguments[0])
       window.arguments[0] = null;
 
--- a/suite/mailnews/compose/messengercompose.xul
+++ b/suite/mailnews/compose/messengercompose.xul
@@ -621,17 +621,17 @@
 <hbox id="sidebar-parent" flex="1">
   <!-- From sidebarOverlay.xul -->
   <vbox id="sidebar-box" class="chromeclass-extrachrome" hidden="true"/>
   <splitter id="sidebar-splitter" class="chromeclass-extrachrome" hidden="true"/>
 
   <!-- The mail message body frame -->
   <vbox id="appcontent" flex="1">
     <editor type="content-primary" id="content-frame" src="about:blank" name="browser.message.body" flex="1"
-            ondblclick="EditorDblClick(event);"
+            onclick="if (event.detail == 2) EditorDblClick(event);"
             context="contentAreaContextMenu"/>
   </vbox>
 </hbox>
 
   <statusbar id="status-bar" class="chromeclass-status">
     <statusbarpanel id="component-bar"/>
     <statusbarpanel id="statusText" flex="1"/>
     <statusbarpanel class="statusbarpanel-progress" id="statusbar-progresspanel" collapsed="true">