MDL-44042 Javascript: Handle moving to the top of the current section with keyboard

This commit is contained in:
Andrew Nicols
2014-02-13 10:11:00 +08:00
parent 974c2cdc03
commit 2ab0238ff6
4 changed files with 29 additions and 2 deletions
@@ -507,6 +507,15 @@ Y.extend(DRAGDROP, Y.Base, {
// Simulate the full sequence.
this.drag_start(dragevent);
this.global_drop_over(dropevent);
if (droptarget.hasClass(this.parentnodeclass) && droptarget.contains(dragcontainer)) {
// The global_drop_over function does not handle the case where an item was moved up, without the
// 'goingup' variable being set, as is the case wih keyboard drag/drop. We must detect this case and
// apply it after the drop_over, but before the drop_hit event in order for it to be moved to the
// correct location.
droptarget.prepend(dragcontainer);
}
this.global_drop_hit(dropevent);
M.core.dragdrop.keydraghandle.focus();
},
File diff suppressed because one or more lines are too long
@@ -507,6 +507,15 @@ Y.extend(DRAGDROP, Y.Base, {
// Simulate the full sequence.
this.drag_start(dragevent);
this.global_drop_over(dropevent);
if (droptarget.hasClass(this.parentnodeclass) && droptarget.contains(dragcontainer)) {
// The global_drop_over function does not handle the case where an item was moved up, without the
// 'goingup' variable being set, as is the case wih keyboard drag/drop. We must detect this case and
// apply it after the drop_over, but before the drop_hit event in order for it to be moved to the
// correct location.
droptarget.prepend(dragcontainer);
}
this.global_drop_hit(dropevent);
M.core.dragdrop.keydraghandle.focus();
},
+9
View File
@@ -505,6 +505,15 @@ Y.extend(DRAGDROP, Y.Base, {
// Simulate the full sequence.
this.drag_start(dragevent);
this.global_drop_over(dropevent);
if (droptarget.hasClass(this.parentnodeclass) && droptarget.contains(dragcontainer)) {
// The global_drop_over function does not handle the case where an item was moved up, without the
// 'goingup' variable being set, as is the case wih keyboard drag/drop. We must detect this case and
// apply it after the drop_over, but before the drop_hit event in order for it to be moved to the
// correct location.
droptarget.prepend(dragcontainer);
}
this.global_drop_hit(dropevent);
M.core.dragdrop.keydraghandle.focus();
},