Bug 472098 - Update context menu code after checkin of bug 462684;patch=Ian Neil;r=berend
authorBerend Cornelius [:berend] <berend.cornelius@sun.com>
Thu, 08 Jan 2009 16:21:31 +0100
changeset 1579 fa451dd88d6370dab7cbddc178dc2b3c8cae5550
parent 1578 718e269e5fc4729710bf6fb6d43f5ac14b90d7d8
child 1580 8848a00c189c7a84cca5974b4608953390b4c66d
push id1260
push userBerend.Cornelius@sun.com
push dateThu, 08 Jan 2009 15:34:32 +0000
treeherdercomm-central@fa451dd88d63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersberend
bugs472098, 462684
Bug 472098 - Update context menu code after checkin of bug 462684;patch=Ian Neil;r=berend
calendar/lightning/content/messenger-overlay-sidebar.js
calendar/lightning/content/messenger-overlay-toolbar.xul
--- a/calendar/lightning/content/messenger-overlay-sidebar.js
+++ b/calendar/lightning/content/messenger-overlay-sidebar.js
@@ -627,42 +627,24 @@ function openInvitationsDialog() {
         function oiD_callback() {
             scheduleInvitationsUpdate(FIRST_DELAY_RESCHEDULE);
         });
 }
 
 document.addEventListener("load", ltnOnLoad, true);
 
 /**
- * Sets up the message pane context menu. Even though the actual context menu
+ * Sets up the mail context menu. Even though the actual context menu
  * is in messenger-overlay-toolbar.xul, this needs to be in a file that
  * directly overlays messenger.xul or the functions will not be defined.
  */
-function calSetupMsgPaneContext() {
+function calSetupMailContext() {
     var hasSelection = (GetFirstSelectedMessage() != null);
 
     // Disable the convert menu altogether
-    setElementValue("messagePaneContext-calendar-convert-menu",
+    setElementValue("mailContext-calendar-convert-menu",
                     !hasSelection && "true",
                     "hidden");
 
-    return calSetupMsgPaneContext.tbSetupMsgPaneContext();
+    return calSetupMailContext.originalFillMailContext();
 }
-calSetupMsgPaneContext.tbSetupMsgPaneContext = fillMessagePaneContextMenu;
-var fillMessagePaneContextMenu = calSetupMsgPaneContext;
-
-/**
- * Sets up the thread pane context menu. Even though the actual context menu
- * is in messenger-overlay-toolbar.xul, this needs to be in a file that
- * directly overlays messenger.xul or the functions will not be defined.
- */
-function calSetupThreadPaneContext() {
-    var hasSelection = (GetFirstSelectedMessage() != null);
-
-    // Disable the convert menu altogether
-    setElementValue("threadPaneContext-calendar-convert-menu",
-                    !hasSelection && "true",
-                    "disabled");
-
-    return calSetupThreadPaneContext.tbSetupThreadPaneContext();
-}
-calSetupThreadPaneContext.tbSetupThreadPaneContext = fillThreadPaneContextMenu;
-var fillThreadPaneContextMenu = calSetupThreadPaneContext;
+calSetupMailContext.originalFillMailContext = fillMailContextMenu;
+let fillMailContextMenu = calSetupMailContext;
--- a/calendar/lightning/content/messenger-overlay-toolbar.xul
+++ b/calendar/lightning/content/messenger-overlay-toolbar.xul
@@ -50,44 +50,27 @@
 ]>
 
 <?xml-stylesheet href="chrome://lightning/skin/lightning.css" type="text/css"?>
 
 <overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
   <script type="application/javascript"
           src="chrome://lightning/content/messenger-overlay-toolbar.js"/>
 
-  <popup id="messagePaneContext">
-    <menu id="messagePaneContext-calendar-convert-menu"
-          insertafter="messagePaneContext-moveMenu"
+  <popup id="mailContext">
+    <menu id="mailContext-calendar-convert-menu"
+          insertafter="mailContext-moveToFolderAgain"
           label="&calendar.context.convertmenu.label;"
           accesskey="&calendar.context.convertmenu.accesskey.mail;">
-      <menupopup id="messagePaneContext-calendar-convert-menupopup">
-        <menuitem id="messagePaneContext-calendar-convert-event-menuitem"
+      <menupopup id="mailContext-calendar-convert-menupopup">
+        <menuitem id="mailContext-calendar-convert-event-menuitem"
                   label="&calendar.context.convertmenu.event.label;"
                   accesskey="&calendar.context.convertmenu.event.accesskey;"
                   oncommand="calendarCalendarButtonDNDObserver.onDropMessage(messenger.msgHdrFromURI(GetFirstSelectedMessage()))"/>
-        <menuitem id="messagePaneContext-calendar-convert-task-menuitem"
-                  label="&calendar.context.convertmenu.task.label;"
-                  accesskey="&calendar.context.convertmenu.task.accesskey;"
-                  oncommand="calendarTaskButtonDNDObserver.onDropMessage(messenger.msgHdrFromURI(GetFirstSelectedMessage()))"/>
-      </menupopup>
-    </menu>
-  </popup>
-  <popup id="threadPaneContext">
-    <menu id="threadPaneContext-calendar-convert-menu"
-          insertafter="threadPaneContext-moveToFolderAgain"
-          label="&calendar.context.convertmenu.label;"
-          accesskey="&calendar.context.convertmenu.accesskey.mail;">
-      <menupopup id="threadPaneContext-calendar-convert-menupopup">
-        <menuitem id="threadPaneContext-calendar-convert-event-menuitem"
-                  label="&calendar.context.convertmenu.event.label;"
-                  accesskey="&calendar.context.convertmenu.event.accesskey;"
-                  oncommand="calendarCalendarButtonDNDObserver.onDropMessage(messenger.msgHdrFromURI(GetFirstSelectedMessage()))"/>
-        <menuitem id="threadPaneContext-calendar-convert-task-menuitem"
+        <menuitem id="mailContext-calendar-convert-task-menuitem"
                   label="&calendar.context.convertmenu.task.label;"
                   accesskey="&calendar.context.convertmenu.task.accesskey;"
                   oncommand="calendarTaskButtonDNDObserver.onDropMessage(messenger.msgHdrFromURI(GetFirstSelectedMessage()))"/>
       </menupopup>
     </menu>
   </popup>
 
   <toolbarbutton id="button-newmsg"