MDL-43723 restrict the drag and drop to the move icon instead of dragging the entire block header

This commit is contained in:
Jerome Mouneyrac 2014-02-17 09:16:53 +08:00
parent 692d247a3a
commit d14f5265b2
6 changed files with 14 additions and 14 deletions

View File

@ -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}
});
@ -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);
@ -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}
});
@ -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');

File diff suppressed because one or more lines are too long

View File

@ -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}
});
@ -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);
@ -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}
});
@ -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');

View File

@ -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');

View File

@ -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}
});
@ -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);

View File

@ -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}
});