MDL-35767 Fix missing target event group check
authorRuslan Kabalin <r.kabalin@lancaster.ac.uk>
Wed, 3 Oct 2012 12:42:10 +0000 (13:42 +0100)
committerRuslan Kabalin <r.kabalin@lancaster.ac.uk>
Wed, 3 Oct 2012 13:34:54 +0000 (14:34 +0100)
Prevent interfering between items from different groups (and no groups)

lib/yui/dragdrop/dragdrop.js

index 20c3a81..c46205b 100644 (file)
@@ -167,6 +167,10 @@ YUI.add('moodle-core-dragdrop', function(Y) {
             // this.lastdroptarget (ghost node we use for indicating where to drop)
             e.drag = e.target;
             e.drop = this.lastdroptarget;
+            // Check that drag object belongs to correct group
+            if (!this.in_group(e.drag)) {
+                return;
+            }
             // Check that drop object belong to correct group
             if (!e.drop || !e.drop.inGroup(this.groups)) {
                 return;