MDL-55861 course: Click drag&drop icon, incorrect activities shown
This commit is contained in:
@@ -383,9 +383,12 @@ Y.extend(DRAGDROP, Y.Base, {
|
||||
// Search for possible drop targets.
|
||||
var droptargets = Y.all('.' + this.samenodeclass + ', .' + this.parentnodeclass);
|
||||
|
||||
droptargets.each(function (node) {
|
||||
droptargets.each(function(node) {
|
||||
var validdrop = false, 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 {
|
||||
@@ -393,12 +396,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
+12
-8
@@ -383,9 +383,12 @@ Y.extend(DRAGDROP, Y.Base, {
|
||||
// Search for possible drop targets.
|
||||
var droptargets = Y.all('.' + this.samenodeclass + ', .' + this.parentnodeclass);
|
||||
|
||||
droptargets.each(function (node) {
|
||||
droptargets.each(function(node) {
|
||||
var validdrop = false, 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 {
|
||||
@@ -393,12 +396,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) {
|
||||
|
||||
Vendored
+12
-8
@@ -381,9 +381,12 @@ Y.extend(DRAGDROP, Y.Base, {
|
||||
// Search for possible drop targets.
|
||||
var droptargets = Y.all('.' + this.samenodeclass + ', .' + this.parentnodeclass);
|
||||
|
||||
droptargets.each(function (node) {
|
||||
droptargets.each(function(node) {
|
||||
var validdrop = false, 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 {
|
||||
@@ -391,12 +394,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) {
|
||||
|
||||
Reference in New Issue
Block a user