mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
Merge branch 'MDL-33192-master-1' of git://git.luns.net.uk/moodle
This commit is contained in:
commit
131bd2f68f
21
lib/yui/dragdrop/dragdrop.js
vendored
21
lib/yui/dragdrop/dragdrop.js
vendored
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user