Fix addPopdown() behavior.
authorMichael M Slusarz <slusarz@curecanti.org>
Mon, 2 Feb 2009 07:00:55 +0000 (00:00 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Mon, 2 Feb 2009 07:04:46 +0000 (00:04 -0700)
imp/js/src/DimpBase.js
imp/js/src/DimpCore.js
imp/js/src/fullmessage-dimp.js

index 9c89af2..bad9c8e 100644 (file)
@@ -2221,11 +2221,11 @@ var DimpBase = {
         this._setFilterText(true);
 
         /* Add popdown menus. */
-        DimpCore.addPopdown('button_reply', 'reply');
+        this._addMouseEvents({ id: 'button_reply', type: 'reply' }, true);
         DimpCore.DMenu.disable('button_reply_img', true, true);
-        DimpCore.addPopdown('button_forward', 'forward');
+        this._addMouseEvents({ id: 'button_forward', type: 'forward' }, true);
         DimpCore.DMenu.disable('button_forward_img', true, true);
-        DimpCore.addPopdown('button_other', 'otheractions');
+        this._addMouseEvents({ id: 'button_other', type: 'otheractions' }, true);
 
         new Drop('dropbase', this._folderDropConfig);
 
index 6dbab5e..11a4842 100644 (file)
@@ -373,14 +373,6 @@ DimpCore = {
         }
     },
 
-    /* Add a popdown menu to a dimpactions button. */
-    addPopdown: function(bid, ctx)
-    {
-        var bidelt = $(bid);
-        bidelt.insert({ after: $($('popdown_img').cloneNode(false)).writeAttribute('id', bid + '_img').show() });
-        this.DMenu.addElement(bid + '_img', 'ctx_' + ctx, { offset: bidelt.up(), left: true });
-    },
-
     /* Add dropdown menus to addresses. */
     buildAddressLinks: function(alist, elt)
     {
index b9e4be8..4644079 100644 (file)
@@ -119,23 +119,34 @@ var DimpFullmessage = {
 
             elt = elt.up();
         }
+    },
+
+    /* Add a popdown menu to a dimpactions button. */
+    addPopdown: function(bid, ctx)
+    {
+        var bidelt = $(bid);
+        bidelt.insert({ after: $($('popdown_img').cloneNode(false)).writeAttribute('id', bid + '_img').show() });
+        DimpCore.DMenu.addElement(bid + '_img', 'ctx_' + ctx, { offset: bidelt.up(), left: true });
     }
 
 };
 
 document.observe('dom:loaded', function() {
+    var FM = DimpFullmessage;
+
     window.focus();
-    DimpCore.addPopdown('reply_link', 'replypopdown');
-    DimpCore.addPopdown('forward_link', 'fwdpopdown');
+
+    FM.addPopdown('reply_link', 'replypopdown');
+    FM.addPopdown('forward_link', 'fwdpopdown');
 
     /* Set up address linking. */
     [ 'from', 'to', 'cc', 'bcc', 'replyTo' ].each(function(a) {
-        if (DimpFullmessage[a]) {
+        if (FM[a]) {
             var elt = $('msgHeader' + a.charAt(0).toUpperCase() + a.substring(1)).down('TD', 1);
-            elt.replace(DimpCore.buildAddressLinks(DimpFullmessage[a], elt.cloneNode(false)));
+            elt.replace(DimpCore.buildAddressLinks(FM[a], elt.cloneNode(false)));
         }
     });
 
     /* Set up click handlers. */
-    document.observe('click', DimpFullmessage._clickHandler.bindAsEventListener(DimpFullmessage));
+    document.observe('click', FM._clickHandler.bindAsEventListener(FM));
 });