MDL-65539 dragdrop: Allow sections and blocks to move to the top

Before this change sections and blocks could not be moved to be the
top item when using keyboard drag and drop.

They can now be moved to the top in one action.

The way they move using keyboard drag and drop has changed when they
are below the item they are dropped on, not instead of appearing
below it they will be placed above it.
This commit is contained in:
Neill Magill 2019-05-13 09:44:41 +01:00
parent 472c953093
commit b08323a789
8 changed files with 16 additions and 4 deletions

View File

@ -48,6 +48,8 @@ Y.extend(DRAGSECTION, M.core.dragdrop, {
this.groups = [CSS.SECTIONDRAGGABLE];
this.samenodeclass = M.course.format.get_sectionwrapperclass();
this.parentnodeclass = M.course.format.get_containerclass();
// Detect the direction of travel.
this.detectkeyboarddirection = true;
// Check if we are in single section mode
if (Y.Node.one('.' + CSS.JUMPMENU)) {

File diff suppressed because one or more lines are too long

View File

@ -48,6 +48,8 @@ Y.extend(DRAGSECTION, M.core.dragdrop, {
this.groups = [CSS.SECTIONDRAGGABLE];
this.samenodeclass = M.course.format.get_sectionwrapperclass();
this.parentnodeclass = M.course.format.get_containerclass();
// Detect the direction of travel.
this.detectkeyboarddirection = true;
// Check if we are in single section mode
if (Y.Node.one('.' + CSS.JUMPMENU)) {

View File

@ -16,6 +16,8 @@ Y.extend(DRAGSECTION, M.core.dragdrop, {
this.groups = [CSS.SECTIONDRAGGABLE];
this.samenodeclass = M.course.format.get_sectionwrapperclass();
this.parentnodeclass = M.course.format.get_containerclass();
// Detect the direction of travel.
this.detectkeyboarddirection = true;
// Check if we are in single section mode
if (Y.Node.one('.' + CSS.JUMPMENU)) {

View File

@ -458,6 +458,8 @@ MANAGER.prototype = {
this.groups = ['block'];
this.samenodeclass = CSS.BLOCK;
this.parentnodeclass = CSS.BLOCKREGION;
// Detect the direction of travel.
this.detectkeyboarddirection = true;
// Add relevant classes and ID to 'content' block region on Dashboard page.
var myhomecontent = Y.Node.all('body#' + CSS.MYINDEX + ' #' + CSS.REGIONMAIN + ' > .' + CSS.REGIONCONTENT);

File diff suppressed because one or more lines are too long

View File

@ -454,6 +454,8 @@ MANAGER.prototype = {
this.groups = ['block'];
this.samenodeclass = CSS.BLOCK;
this.parentnodeclass = CSS.BLOCKREGION;
// Detect the direction of travel.
this.detectkeyboarddirection = true;
// Add relevant classes and ID to 'content' block region on Dashboard page.
var myhomecontent = Y.Node.all('body#' + CSS.MYINDEX + ' #' + CSS.REGIONMAIN + ' > .' + CSS.REGIONCONTENT);

View File

@ -66,6 +66,8 @@ MANAGER.prototype = {
this.groups = ['block'];
this.samenodeclass = CSS.BLOCK;
this.parentnodeclass = CSS.BLOCKREGION;
// Detect the direction of travel.
this.detectkeyboarddirection = true;
// Add relevant classes and ID to 'content' block region on Dashboard page.
var myhomecontent = Y.Node.all('body#' + CSS.MYINDEX + ' #' + CSS.REGIONMAIN + ' > .' + CSS.REGIONCONTENT);