Skip to content

Commit

Permalink
Merge branch 'MDL-55861-master' of https://github.com/dj4452/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
danpoltawski committed Oct 4, 2016
2 parents 461e98c + 9b24ebd commit ed3956a
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 23 deletions.
18 changes: 11 additions & 7 deletions lib/yui/build/moodle-core-dragdrop/moodle-core-dragdrop-debug.js
Expand Up @@ -422,20 +422,24 @@ Y.extend(DRAGDROP, Y.Base, {
droptargets.each(function(node) {
var validdrop = false;
var labelroot = node;
if (node.drop && node.drop.inGroup(this.groups) && node.drop.get('node') !== dragcontainer) {
var className = node.getAttribute("class").split(' ').join(', .');

if (node.drop && node.drop.inGroup(this.groups) && node.drop.get('node') !== dragcontainer &&
node.next(className) !== dragcontainer) {
// This is a drag and drop target with the same class as the grabbed node.
validdrop = true;
} else {
var elementgroups = node.getAttribute('data-draggroups').split(' ');
var i, j;
for (i = 0; i < elementgroups.length; i++) {
for (j = 0; j < this.groups.length; j++) {
if (elementgroups[i] === this.groups[j]) {
// This is a parent node of the grabbed node (used for dropping in empty sections).
validdrop = true;
// This node will have no text - so we get the first valid text from the parent.
labelroot = node.get('parentNode');
break;
if (elementgroups[i] === this.groups[j] && !(node == dragcontainer ||
node.next(className) === dragcontainer || node.get('children').item(0) == dragcontainer)) {
// This is a parent node of the grabbed node (used for dropping in empty sections).
validdrop = true;
// This node will have no text - so we get the first valid text from the parent.
labelroot = node.get('parentNode');
break;
}
}
if (validdrop) {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 11 additions & 7 deletions lib/yui/build/moodle-core-dragdrop/moodle-core-dragdrop.js
Expand Up @@ -422,20 +422,24 @@ Y.extend(DRAGDROP, Y.Base, {
droptargets.each(function(node) {
var validdrop = false;
var labelroot = node;
if (node.drop && node.drop.inGroup(this.groups) && node.drop.get('node') !== dragcontainer) {
var className = node.getAttribute("class").split(' ').join(', .');

if (node.drop && node.drop.inGroup(this.groups) && node.drop.get('node') !== dragcontainer &&
node.next(className) !== dragcontainer) {
// This is a drag and drop target with the same class as the grabbed node.
validdrop = true;
} else {
var elementgroups = node.getAttribute('data-draggroups').split(' ');
var i, j;
for (i = 0; i < elementgroups.length; i++) {
for (j = 0; j < this.groups.length; j++) {
if (elementgroups[i] === this.groups[j]) {
// This is a parent node of the grabbed node (used for dropping in empty sections).
validdrop = true;
// This node will have no text - so we get the first valid text from the parent.
labelroot = node.get('parentNode');
break;
if (elementgroups[i] === this.groups[j] && !(node == dragcontainer ||
node.next(className) === dragcontainer || node.get('children').item(0) == dragcontainer)) {
// This is a parent node of the grabbed node (used for dropping in empty sections).
validdrop = true;
// This node will have no text - so we get the first valid text from the parent.
labelroot = node.get('parentNode');
break;
}
}
if (validdrop) {
Expand Down

0 comments on commit ed3956a

Please sign in to comment.