diff options
author | Adhitya Kamakshidasan | 2016-06-01 19:51:22 +0530 |
---|---|---|
committer | Adhitya Kamakshidasan | 2016-06-01 19:51:22 +0530 |
commit | b2ae20e4a0670ec888a7af07fb25569bbc841556 (patch) | |
tree | c06468e6c01ec4288d4401d16c08503022a1a3f9 | |
parent | d51ae668143e7481d796be575a7ece8a45cb0161 (diff) | |
download | xcos-on-web-b2ae20e4a0670ec888a7af07fb25569bbc841556.tar.gz xcos-on-web-b2ae20e4a0670ec888a7af07fb25569bbc841556.tar.bz2 xcos-on-web-b2ae20e4a0670ec888a7af07fb25569bbc841556.zip |
Removed a bug
Click on a block --> Click on a button --> Try to use direction keys -->
It doesn't work because focus does not move away from the button
Works good now!
-rw-r--r-- | index.html | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -8,11 +8,11 @@ BODY { font-family: Arial; } - + H1 { font-size: 18px; } - + H2 { font-size: 16px; } @@ -321,7 +321,6 @@ // Handles cursor keys - guides.html var nudge = function(keyCode) { - graph.container.focus(); if (!graph.isSelectionEmpty()) { var dx = 0; var dy = 0; @@ -383,8 +382,18 @@ connectionHandlerMouseUp.apply(this, arguments); }; - mxEvent.disableContextMenu(container); + + // @Adhitya: Add focus to a mxCell + if (mxClient.IS_NS) { + mxEvent.addListener(graph.container, 'mousedown', function(evt) { + if (!graph.isEditing()) { + graph.container.setAttribute('tabindex', '-1'); + graph.container.focus(); + } + }); + } + } }; @@ -570,7 +579,6 @@ wnd.addListener(mxEvent.DESTROY, function(evt) { graph.setEnabled(true); mxEffects.fadeOut(background, 50, true, 10, 30, true); - //alert("jitesh"); }); graph.setEnabled(false); |