Bug #9006: Don't trigger contextmenu on reply/forward buttons
authorMichael M Slusarz <slusarz@curecanti.org>
Wed, 5 May 2010 16:02:50 +0000 (10:02 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Wed, 5 May 2010 16:04:10 +0000 (10:04 -0600)
imp/js/DimpBase.js
imp/js/DimpCore.js

index 59f8e64..00a2251 100644 (file)
@@ -2965,8 +2965,8 @@ var DimpBase = {
         this._setQsearchText(true);
 
         /* Add popdown menus. Check for disabled compose at the same time. */
-        DimpCore.addPopdown('button_other', 'otheractions');
-        DimpCore.addPopdown('folderopts_link', 'folderopts');
+        DimpCore.addPopdown('button_other', 'otheractions', true);
+        DimpCore.addPopdown('folderopts_link', 'folderopts', true);
 
         DM.addSubMenu('ctx_message_reply', 'ctx_reply');
         DM.addSubMenu('ctx_message_forward', 'ctx_forward');
@@ -2981,8 +2981,8 @@ var DimpBase = {
         if (DIMP.conf.disable_compose) {
             $('button_reply', 'button_forward').compact().invoke('up', 'SPAN').concat($('button_compose', 'composelink', 'ctx_contacts_new')).compact().invoke('remove');
         } else {
-            DimpCore.addPopdown('button_reply', 'reply', true);
-            DimpCore.addPopdown('button_forward', 'forward', true);
+            DimpCore.addPopdown('button_reply', 'reply', false, true);
+            DimpCore.addPopdown('button_forward', 'forward', false, true);
         }
 
         DimpCore.addContextMenu({
index 2268c2c..ae4dcf4 100644 (file)
@@ -331,21 +331,24 @@ var DimpCore = {
 
     // p = (Element) Parent element
     // t = (string) Context menu type
+    // trigger = (boolean) Trigger popdown on button click?
     // d = (boolean) Disabled?
-    addPopdown: function(p, t, d)
+    addPopdown: function(p, t, trigger, d)
     {
         var elt = new Element('SPAN', { className: 'iconImg popdownImg popdown' });
         p = $(p);
 
         p.insert({ after: elt });
 
-        this.addContextMenu({
-            disable: d,
-            id: p.identify(),
-            left: true,
-            offset: p.up(),
-            type: t
-        });
+        if (trigger) {
+            this.addContextMenu({
+                disable: d,
+                id: p.identify(),
+                left: true,
+                offset: p.up(),
+                type: t
+            });
+        }
 
         this.addContextMenu({
             disable: d,