MDL-35767 Fix missing target event group check

Prevent interfering between items from different groups (and no groups)
This commit is contained in:
Ruslan Kabalin 2012-10-03 13:42:10 +01:00
parent 5d6285c220
commit 2596265b36

View 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;