Skip to content

Commit

Permalink
MDL-65539 dragdrop: Allow sections and blocks to move to the top
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
NeillM committed Apr 3, 2020
1 parent 472c953 commit b08323a
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

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

Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
2 changes: 2 additions & 0 deletions course/yui/src/dragdrop/js/section.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
2 changes: 2 additions & 0 deletions lib/yui/build/moodle-core-blocks/moodle-core-blocks-debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading

0 comments on commit b08323a

Please sign in to comment.