Merge branch 'MDL-33192-master-1' of git://git.luns.net.uk/moodle

This commit is contained in:
Dan Poltawski 2012-05-28 11:47:22 +08:00
commit 131bd2f68f

View File

@ -69,14 +69,23 @@ YUI.add('moodle-core-dragdrop', function(Y) {
return new M.core.exception(e);
},
in_group: function(target) {
var ret = false;
Y.each(this.groups, function(v, k) {
if (target._groups[v]) {
ret = true;
}
}, this);
return ret;
},
/*
* Drag-dropping related functions
*/
global_drag_start : function(e) {
// Get our drag object
var drag = e.target;
// Check that drop object belong to correct group
if (!drag.target.inGroup(this.groups)) {
// Check that drag object belongs to correct group
if (!this.in_group(drag)) {
return;
}
// Set some general styles here
@ -92,8 +101,8 @@ YUI.add('moodle-core-dragdrop', function(Y) {
global_drag_end : function(e) {
var drag = e.target;
// Check that drop object belong to correct group
if (!drag.target.inGroup(this.groups)) {
// Check that drag object belongs to correct group
if (!this.in_group(drag)) {
return;
}
//Put our general styles back
@ -106,8 +115,8 @@ YUI.add('moodle-core-dragdrop', function(Y) {
global_drag_drag : function(e) {
var drag = e.target;
// Check that drop object belong to correct group
if (!drag.target.inGroup(this.groups)) {
// Check that drag object belongs to correct group
if (!this.in_group(drag)) {
return;
}
//Get the last y point