From aa54cf8a4ed7574d6b767c5f543d4ecd213d30f5 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Fri, 21 Mar 2014 17:55:14 -0600 Subject: [PATCH] Consistently use _removeMouseEvents to do cleanup --- imp/js/dimpbase.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/imp/js/dimpbase.js b/imp/js/dimpbase.js index 9c222d73b11..665d835df78 100644 --- a/imp/js/dimpbase.js +++ b/imp/js/dimpbase.js @@ -625,7 +625,7 @@ var DimpBase = { }.bindAsEventListener(this)); container.observe('ViewPort:clear', function(e) { - this._removeMouseEvents(e.memo); + this._removeMouseEvents([ e.memo ]); }.bindAsEventListener(this)); container.observe('ViewPort:contentComplete', function() { @@ -842,15 +842,17 @@ var DimpBase = { _removeMouseEvents: function(elt) { - var d, id = $(elt).readAttribute('id'); + elt.each(function(a) { + var d, id = $(a).readAttribute('id'); - if (id) { - if ((d = DragDrop.Drags.getDrag(id))) { - d.destroy(); - } + if (id) { + if ((d = DragDrop.Drags.getDrag(id))) { + d.destroy(); + } - DimpCore.DMenu.removeElement(id); - } + DimpCore.DMenu.removeElement(id); + } + }); }, contextOnClick: function(e) @@ -1774,9 +1776,7 @@ var DimpBase = { pm = $('previewMsg'), r = this.ppcache[this._getPPId(uid, mbox)]; - pm.select('.address').each(function(elt) { - DimpCore.DMenu.removeElement(elt.identify()); - }); + this._removeMouseEvents(pm.down('.msgHeaders').select('.address')); // Add subject. Subject was already html encoded on server (subject // may include links). @@ -3688,7 +3688,7 @@ var DimpBase = { submbox.remove(); } [ DragDrop.Drags.getDrag(m), DragDrop.Drops.getDrop(m) ].compact().invoke('destroy'); - this._removeMouseEvents(m_elt); + this._removeMouseEvents([ m_elt ]); if (this.viewport) { this.viewport.deleteView(m_elt.retrieve('mbox')); }