mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-55861 course: Click drag&drop icon, incorrect activities shown
This commit is contained in:
parent
ddd8dc0d1b
commit
9b24ebd665
@ -422,7 +422,10 @@ 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 {
|
||||
@ -430,12 +433,13 @@ Y.extend(DRAGDROP, Y.Base, {
|
||||
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) {
|
||||
|
File diff suppressed because one or more lines are too long
@ -422,7 +422,10 @@ 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 {
|
||||
@ -430,12 +433,13 @@ Y.extend(DRAGDROP, Y.Base, {
|
||||
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) {
|
||||
|
18
lib/yui/src/dragdrop/js/dragdrop.js
vendored
18
lib/yui/src/dragdrop/js/dragdrop.js
vendored
@ -420,7 +420,10 @@ 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 {
|
||||
@ -428,12 +431,13 @@ Y.extend(DRAGDROP, Y.Base, {
|
||||
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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user