Bug 607583 - Move updateOptionItems() call from xul to js; (Bv1) Revert MsgComposeCommands.js part of patch Av1, Port bug 609926 fix instead.
authorSerge Gautherie <sgautherie.bz@free.fr>
Fri, 19 Nov 2010 00:15:33 +0100
changeset 6719 ec3138bfe33afa9ec0fcc1ef8e8862e530a0d49d
parent 6718 7f98b2c78c31e04ff2c557ef179053e3f8cd7a00
child 6720 58f105a58d5b2f12de3daed55f115ffd465f31a5
push id5162
push usersgautherie.bz@free.fr
push dateThu, 18 Nov 2010 23:17:48 +0000
treeherdercomm-central@ec3138bfe33a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs607583, 609926
Bug 607583 - Move updateOptionItems() call from xul to js; (Bv1) Revert MsgComposeCommands.js part of patch Av1, Port bug 609926 fix instead. r=iann_bugzilla.
suite/mailnews/compose/MsgComposeCommands.js
--- a/suite/mailnews/compose/MsgComposeCommands.js
+++ b/suite/mailnews/compose/MsgComposeCommands.js
@@ -574,20 +574,26 @@ function GetSelectedMessages()
   }
 
   return null;
 }
 
 function SetupCommandUpdateHandlers()
 {
   top.controllers.insertControllerAt(0, defaultController);
+
+  document.getElementById("optionsMenuPopup")
+          .addEventListener("popupshowing", updateOptionItems, true);
 }
 
 function UnloadCommandUpdateHandlers()
 {
+  document.getElementById("optionsMenuPopup")
+          .removeEventListener("popupshowing", updateOptionItems, true);
+
   top.controllers.removeController(defaultController);
 }
 
 function CommandUpdate_MsgCompose()
 {
   var focusedWindow = top.document.commandDispatcher.focusedWindow;
 
   // we're just setting focus to where it was before
@@ -623,17 +629,16 @@ function updateComposeItems()
       goUpdateCommand("cmd_indent");
       goUpdateCommand("cmd_outdent");
       goUpdateCommand("cmd_align");
       goUpdateCommand("cmd_smiley");
     }
 
     // Options Menu
     goUpdateCommand("cmd_spelling");
-    goUpdateCommand("cmd_quoteMessage");
   } catch(e) {}
 }
 
 function openEditorContextMenu(popup)
 {
   // if we have a mispelled word, show spellchecker context
   // menuitems as well as the usual context menu
   InlineSpellCheckerUI.clearSuggestionsFromMenu();
@@ -658,16 +663,21 @@ function updateEditItems()
   goUpdateCommand("cmd_renameAttachment");
   goUpdateCommand("cmd_selectAll");
   goUpdateCommand("cmd_openAttachment");
   goUpdateCommand("cmd_find");
   goUpdateCommand("cmd_findNext");
   goUpdateCommand("cmd_findPrev");
 }
 
+function updateOptionItems()
+{
+  goUpdateCommand("cmd_quoteMessage");
+}
+
 var messageComposeOfflineObserver = {
   observe: function(subject, topic, state) {
     // sanity checks
     if (topic != "network:offline-status-changed") return;
     if (state == "offline")
       gIsOffline = true;
     else
       gIsOffline = false;