Simplify
authorJan Schneider <jan@horde.org>
Wed, 16 Jun 2010 16:51:19 +0000 (18:51 +0200)
committerJan Schneider <jan@horde.org>
Wed, 16 Jun 2010 16:51:19 +0000 (18:51 +0200)
horde/js/dragdrop2.js

index 69f82cc..ad135d7 100644 (file)
@@ -170,15 +170,9 @@ var DragDrop = {
 
         _mouseHandler: function(e)
         {
-            var elt = e.element();
-
-            if (this.drags.size()) {
-                if (!elt.hasClassName('DragElt')) {
-                    elt = elt.up('.DragElt');
-                }
-                if (elt) {
-                    this.getDrag(elt).mouseDown(e);
-                }
+            var elt = e.findElement('.DragElt');
+            if (this.drags.size() && elt) {
+                this.getDrag(elt).mouseDown(e);
             }
         }