Skip to content

Commit

Permalink
MDL-40759 dragdrop: Use a pix icon renderer for drag handles.
Browse files Browse the repository at this point in the history
  • Loading branch information
Damyon Wiese committed Mar 17, 2017
1 parent d3d2f09 commit e6bf10c
Show file tree
Hide file tree
Showing 21 changed files with 70 additions and 100 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ Y.extend(DRAGREORDER, M.core.dragdrop, {
this.samenodeclass = args.sameNodeClass;
this.parentnodeclass = args.parentNodeClass;
this.draghandleinsertclass = args.dragHandleInsertClass;
this.draghandle = this.get_drag_handle(args.dragHandleText,
CSS.EDITINGMOVE, CSS.ICONCLASS, true);

this.samenodelabel = args.sameNodeLabel;
this.parentnodelabel = args.parentNodeLabel;
Expand All @@ -49,7 +47,8 @@ Y.extend(DRAGREORDER, M.core.dragdrop, {
.all('.' + args.dragHandleInsertClass)
.each(
function(node) {
node.insert(this.draghandle.cloneNode(true));
var draghandle = this.get_drag_handle(args.dragHandleText, CSS.EDITINGMOVE, CSS.ICONCLASS, true);
node.insert(draghandle);
}, this);
},

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 @@ -28,8 +28,6 @@ Y.extend(DRAGREORDER, M.core.dragdrop, {
this.samenodeclass = args.sameNodeClass;
this.parentnodeclass = args.parentNodeClass;
this.draghandleinsertclass = args.dragHandleInsertClass;
this.draghandle = this.get_drag_handle(args.dragHandleText,
CSS.EDITINGMOVE, CSS.ICONCLASS, true);

this.samenodelabel = args.sameNodeLabel;
this.parentnodelabel = args.parentNodeLabel;
Expand All @@ -49,7 +47,8 @@ Y.extend(DRAGREORDER, M.core.dragdrop, {
.all('.' + args.dragHandleInsertClass)
.each(
function(node) {
node.insert(this.draghandle.cloneNode(true));
var draghandle = this.get_drag_handle(args.dragHandleText, CSS.EDITINGMOVE, CSS.ICONCLASS, true);
node.insert(draghandle);
}, this);
},

Expand Down
5 changes: 2 additions & 3 deletions admin/tool/lp/yui/src/dragdrop-reorder/js/dragdropreorder.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ Y.extend(DRAGREORDER, M.core.dragdrop, {
this.samenodeclass = args.sameNodeClass;
this.parentnodeclass = args.parentNodeClass;
this.draghandleinsertclass = args.dragHandleInsertClass;
this.draghandle = this.get_drag_handle(args.dragHandleText,
CSS.EDITINGMOVE, CSS.ICONCLASS, true);

this.samenodelabel = args.sameNodeLabel;
this.parentnodelabel = args.parentNodeLabel;
Expand All @@ -47,7 +45,8 @@ Y.extend(DRAGREORDER, M.core.dragdrop, {
.all('.' + args.dragHandleInsertClass)
.each(
function(node) {
node.insert(this.draghandle.cloneNode(true));
var draghandle = this.get_drag_handle(args.dragHandleText, CSS.EDITINGMOVE, CSS.ICONCLASS, true);
node.insert(draghandle);
}, this);
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,6 @@ Y.extend(DRAGRESOURCE, M.core.dragdrop, {
this.groups = ['resource'];
this.samenodeclass = CSS.ACTIVITY;
this.parentnodeclass = CSS.SECTION;
this.resourcedraghandle = this.get_drag_handle(M.util.get_string('movecoursemodule', 'moodle'),
CSS.EDITINGMOVE, CSS.ICONCLASS, true);

this.samenodelabel = {
identifier: 'afterresource',
Expand Down Expand Up @@ -424,7 +422,8 @@ Y.extend(DRAGRESOURCE, M.core.dragdrop, {
var move = resourcesnode.one('a.' + CSS.EDITINGMOVE);
if (move) {
var sr = move.getData('sr');
move.replace(this.resourcedraghandle.cloneNode(true).setAttribute('data-sectionreturn', sr));
move.replace(this.get_drag_handle(M.util.get_string('movecoursemodule', 'moodle'),
CSS.EDITINGMOVE, CSS.ICONCLASS, true).setAttribute('data-sectionreturn', sr));
}
}, this);
},
Expand Down
Loading

0 comments on commit e6bf10c

Please sign in to comment.