fix Ctrl+A (#814)

This commit is contained in:
Devin Howard 2016-10-23 18:02:59 +08:00 committed by GitHub
parent 497c6ae017
commit 154257d062

View file

@ -17,6 +17,8 @@ const Listeners = {
$(document).on('keydown', function (e) {
if (!(Active.Map || Active.Topic)) return
const onCanvas = e.target.tagName === 'BODY'
switch (e.which) {
case 13: // if enter key is pressed
// prevent topic creation if sending a message
@ -28,7 +30,7 @@ const Listeners = {
JIT.escKeyHandler()
break
case 65: // if a or A is pressed
if (e.ctrlKey || e.metaKey) {
if ((e.ctrlKey || e.metaKey) && onCanvas) {
Control.deselectAllNodes()
Control.deselectAllEdges()