Commit 0d747a8f authored by Son Nguyen's avatar Son Nguyen
Browse files

Make sure the pop-up 'Add block' called once when click


Bug 1305451 and 1305481

MouseEvent.buttons is not defined in Chrome, use button insteads

Change-Id: Icf51e74ba64893925061e35e601fa40b4f761650
Signed-off-by: default avatarSon Nguyen <son.nguyen@catalyst.net.nz>
parent 26263d6f
......@@ -408,7 +408,8 @@
$(this).find('.blocktypelink').off('click keydown'); // remove old event handlers
$(this).find('.blocktypelink').on('click keydown', function(e) {
var keyCode = $.ui.keyCode;
if ((e.type == 'click' && e.buttons > 0) || e.keyCode == keyCode.SPACE || e.keyCode == keyCode.ENTER) {
// Add a block when click left button or press 'Space bar' or 'Enter' key
if (((e.type == 'click' && e.button == 0) || e.keyCode == keyCode.SPACE || e.keyCode == keyCode.ENTER) && ($('#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