Skip to content

Commit

Permalink
MDL-43723 restrict the drag and drop to the move icon instead of drag…
Browse files Browse the repository at this point in the history
…ging the entire block header
  • Loading branch information
mouneyrac committed Feb 17, 2014
1 parent 692d247 commit d14f526
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions lib/yui/build/moodle-core-blocks/moodle-core-blocks-debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Y.extend(DRAGBLOCK, M.core.dragdrop, {
container: blockregionnode,
nodes: '.'+CSS.BLOCK,
target: true,
handles: ['.'+CSS.HEADER],
handles: ['.'+CSS.HEADER+' .commands .moodle-core-dragdrop-draghandle'],
invalid: '.block-hider-hide, .block-hider-show, .moveto',
dragConfig: {groups: this.groups}
});
Expand All @@ -116,7 +116,7 @@ Y.extend(DRAGBLOCK, M.core.dragdrop, {
var move = blocknode.one('a.'+CSS.EDITINGMOVE);
if (move) {
move.replace(this.get_drag_handle(move.getAttribute('title'), '', 'iconsmall', true));
blocknode.one('.'+CSS.HEADER).setStyle('cursor', 'move');
blocknode.one('.'+CSS.HEADER+' .commands .moodle-core-dragdrop-draghandle').setStyle('cursor', 'move');
}
}, this);
}, this);
Expand Down Expand Up @@ -480,7 +480,7 @@ MANAGER.prototype = {
container: region.get_droptarget(),
nodes: '.'+CSS.BLOCK,
target: true,
handles: ['.'+CSS.HEADER],
handles: ['.'+CSS.HEADER+' .commands .moodle-core-dragdrop-draghandle'],
invalid: '.block-hider-hide, .block-hider-show, .moveto',
dragConfig: {groups: this.groups}
});
Expand Down Expand Up @@ -873,7 +873,7 @@ BLOCKREGION.prototype = {
change_block_move_icons : function(manager) {
var handle, icon;
this.get('node').all('.'+CSS.BLOCK+' a.'+CSS.EDITINGMOVE).each(function(moveicon){
moveicon.ancestor('.'+CSS.BLOCK).one('.'+CSS.HEADER).setStyle('cursor', 'move');
moveicon.setStyle('cursor', 'move');
handle = manager.get_drag_handle(moveicon.getAttribute('title'), '', 'icon', true);
icon = handle.one('img');
icon.addClass('iconsmall');
Expand Down
4 changes: 2 additions & 2 deletions lib/yui/build/moodle-core-blocks/moodle-core-blocks-min.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions lib/yui/build/moodle-core-blocks/moodle-core-blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Y.extend(DRAGBLOCK, M.core.dragdrop, {
container: blockregionnode,
nodes: '.'+CSS.BLOCK,
target: true,
handles: ['.'+CSS.HEADER],
handles: ['.'+CSS.HEADER+' .commands .moodle-core-dragdrop-draghandle'],
invalid: '.block-hider-hide, .block-hider-show, .moveto',
dragConfig: {groups: this.groups}
});
Expand All @@ -116,7 +116,7 @@ Y.extend(DRAGBLOCK, M.core.dragdrop, {
var move = blocknode.one('a.'+CSS.EDITINGMOVE);
if (move) {
move.replace(this.get_drag_handle(move.getAttribute('title'), '', 'iconsmall', true));
blocknode.one('.'+CSS.HEADER).setStyle('cursor', 'move');
blocknode.one('.'+CSS.HEADER+' .commands .moodle-core-dragdrop-draghandle').setStyle('cursor', 'move');
}
}, this);
}, this);
Expand Down Expand Up @@ -479,7 +479,7 @@ MANAGER.prototype = {
container: region.get_droptarget(),
nodes: '.'+CSS.BLOCK,
target: true,
handles: ['.'+CSS.HEADER],
handles: ['.'+CSS.HEADER+' .commands .moodle-core-dragdrop-draghandle'],
invalid: '.block-hider-hide, .block-hider-show, .moveto',
dragConfig: {groups: this.groups}
});
Expand Down Expand Up @@ -869,7 +869,7 @@ BLOCKREGION.prototype = {
change_block_move_icons : function(manager) {
var handle, icon;
this.get('node').all('.'+CSS.BLOCK+' a.'+CSS.EDITINGMOVE).each(function(moveicon){
moveicon.ancestor('.'+CSS.BLOCK).one('.'+CSS.HEADER).setStyle('cursor', 'move');
moveicon.setStyle('cursor', 'move');
handle = manager.get_drag_handle(moveicon.getAttribute('title'), '', 'icon', true);
icon = handle.one('img');
icon.addClass('iconsmall');
Expand Down
2 changes: 1 addition & 1 deletion lib/yui/src/blocks/js/blockregion.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ BLOCKREGION.prototype = {
change_block_move_icons : function(manager) {
var handle, icon;
this.get('node').all('.'+CSS.BLOCK+' a.'+CSS.EDITINGMOVE).each(function(moveicon){
moveicon.ancestor('.'+CSS.BLOCK).one('.'+CSS.HEADER).setStyle('cursor', 'move');
moveicon.setStyle('cursor', 'move');
handle = manager.get_drag_handle(moveicon.getAttribute('title'), '', 'icon', true);
icon = handle.one('img');
icon.addClass('iconsmall');
Expand Down
4 changes: 2 additions & 2 deletions lib/yui/src/blocks/js/blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Y.extend(DRAGBLOCK, M.core.dragdrop, {
container: blockregionnode,
nodes: '.'+CSS.BLOCK,
target: true,
handles: ['.'+CSS.HEADER],
handles: ['.'+CSS.HEADER+' .commands .moodle-core-dragdrop-draghandle'],
invalid: '.block-hider-hide, .block-hider-show, .moveto',
dragConfig: {groups: this.groups}
});
Expand All @@ -114,7 +114,7 @@ Y.extend(DRAGBLOCK, M.core.dragdrop, {
var move = blocknode.one('a.'+CSS.EDITINGMOVE);
if (move) {
move.replace(this.get_drag_handle(move.getAttribute('title'), '', 'iconsmall', true));
blocknode.one('.'+CSS.HEADER).setStyle('cursor', 'move');
blocknode.one('.'+CSS.HEADER+' .commands .moodle-core-dragdrop-draghandle').setStyle('cursor', 'move');
}
}, this);
}, this);
Expand Down
2 changes: 1 addition & 1 deletion lib/yui/src/blocks/js/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ MANAGER.prototype = {
container: region.get_droptarget(),
nodes: '.'+CSS.BLOCK,
target: true,
handles: ['.'+CSS.HEADER],
handles: ['.'+CSS.HEADER+' .commands .moodle-core-dragdrop-draghandle'],
invalid: '.block-hider-hide, .block-hider-show, .moveto',
dragConfig: {groups: this.groups}
});
Expand Down

0 comments on commit d14f526

Please sign in to comment.