From 9489adc5936fd516f3f6df91cfce3697b36e2cf1 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Tue, 02 Jun 2009 11:46:14 -0400
Subject: [PATCH] Fix list events used in drag&drop functionality (#1485890)

---
 program/js/list.js |   26 +++++++++++++++++++++++++-
 1 files changed, 25 insertions(+), 1 deletions(-)

diff --git a/program/js/list.js b/program/js/list.js
index addd1e6..aa34546 100644
--- a/program/js/list.js
+++ b/program/js/list.js
@@ -530,6 +530,30 @@
 
 
 /**
+ * Invert selection
+ */
+invert_selection: function()
+{
+  if (!this.rows || !this.rows.length)
+    return false;
+
+  // remember old selection
+  var select_before = this.selection.join(',');
+  
+  for (var n in this.rows)
+    this.highlight_row(n, true);    
+
+  // trigger event if selection changed
+  if (this.selection.join(',') != select_before)
+    this.triggerEvent('select');
+
+  this.focus();
+
+  return true;
+},
+
+
+/**
  * Unselect selected row(s)
  */
 clear_selection: function(id)
@@ -781,7 +805,7 @@
   {
     var pos = rcube_event.get_mouse_pos(e);
     this.draglayer.css({ left:(pos.x+20)+'px', top:(pos.y-5 + (bw.ie ? document.documentElement.scrollTop : 0))+'px' });
-    this.triggerEvent('dragmove', e);
+    this.triggerEvent('dragmove', e?e:window.event);
   }
 
   this.drag_start = false;

--
Gitblit v1.9.1