Skip to content

Commit

Permalink
Merge branch 'MDL-33192-master-1' of git://git.luns.net.uk/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
danpoltawski committed May 28, 2012
2 parents d8a05d8 + a252a14 commit 131bd2f
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions lib/yui/dragdrop/dragdrop.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -69,14 +69,23 @@ YUI.add('moodle-core-dragdrop', function(Y) {
return new M.core.exception(e); 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 * Drag-dropping related functions
*/ */
global_drag_start : function(e) { global_drag_start : function(e) {
// Get our drag object // Get our drag object
var drag = e.target; var drag = e.target;
// Check that drop object belong to correct group // Check that drag object belongs to correct group
if (!drag.target.inGroup(this.groups)) { if (!this.in_group(drag)) {
return; return;
} }
// Set some general styles here // Set some general styles here
Expand All @@ -92,8 +101,8 @@ YUI.add('moodle-core-dragdrop', function(Y) {


global_drag_end : function(e) { global_drag_end : function(e) {
var drag = e.target; var drag = e.target;
// Check that drop object belong to correct group // Check that drag object belongs to correct group
if (!drag.target.inGroup(this.groups)) { if (!this.in_group(drag)) {
return; return;
} }
//Put our general styles back //Put our general styles back
Expand All @@ -106,8 +115,8 @@ YUI.add('moodle-core-dragdrop', function(Y) {


global_drag_drag : function(e) { global_drag_drag : function(e) {
var drag = e.target; var drag = e.target;
// Check that drop object belong to correct group // Check that drag object belongs to correct group
if (!drag.target.inGroup(this.groups)) { if (!this.in_group(drag)) {
return; return;
} }
//Get the last y point //Get the last y point
Expand Down

0 comments on commit 131bd2f

Please sign in to comment.