mirror of
https://github.com/moodle/moodle.git
synced 2025-04-20 07:56:06 +02:00
MDL-43723 restrict the drag and drop to the move icon instead of dragging the entire block header
This commit is contained in:
parent
692d247a3a
commit
d14f5265b2
@ -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
@ -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');
|
||||
|
2
lib/yui/src/blocks/js/blockregion.js
vendored
2
lib/yui/src/blocks/js/blockregion.js
vendored
@ -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');
|
||||
|
4
lib/yui/src/blocks/js/blocks.js
vendored
4
lib/yui/src/blocks/js/blocks.js
vendored
@ -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);
|
||||
|
2
lib/yui/src/blocks/js/manager.js
vendored
2
lib/yui/src/blocks/js/manager.js
vendored
@ -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}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user