Commit d4cbe95c authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Fixing problem where drag and click both fire (Bug #1341413)



Change-Id: I596099e895c4199ab699dd7a2e14803822832338
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 97d916c2
......@@ -400,13 +400,6 @@
function makeNewBlocksDraggable() {
$('.blocktype-list div.blocktype').each(function() {
$(this).find('.blocktypelink').off('mousedown keydown'); // remove old event handlers
$(this).find('.blocktypelink').on('mousedown keydown', function(e) {
// Add a block when click left button or press 'Space bar' or 'Enter' key
if (isHit(e) && $('#addblock').is(':hidden')) {
startAddBlock($(this));
}
});
$(this).draggable({
start: function(event, ui) {
showColumnBackgrounds();
......@@ -427,6 +420,14 @@
},
appendTo: 'body'
});
$(this).find('.blocktypelink').off('mouseup keydown'); // remove old event handlers
$(this).find('.blocktypelink').on('mouseup keydown', function(e) {
// Add a block when click left button or press 'Space bar' or 'Enter' key
if (isHit(e) && $('#addblock').is(':hidden')) {
startAddBlock($(this));
}
});
});
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment