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

Conflicts:
	lib/yui/build/moodle-core-blocks/moodle-core-blocks-min.js
This commit is contained in:
Jerome Mouneyrac
2014-02-17 09:21:58 +08:00
parent 3e6e38b2e3
commit fd9233c1b9
6 changed files with 14 additions and 14 deletions
@@ -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}
});
@@ -870,7 +870,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
+4 -4
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}
});
@@ -866,7 +866,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');
+1 -1
View File
@@ -95,7 +95,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 -2
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);
+1 -1
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}
});