fix Ctrl+A (#814)
This commit is contained in:
parent
497c6ae017
commit
154257d062
1 changed files with 3 additions and 1 deletions
|
@ -17,6 +17,8 @@ const Listeners = {
|
||||||
$(document).on('keydown', function (e) {
|
$(document).on('keydown', function (e) {
|
||||||
if (!(Active.Map || Active.Topic)) return
|
if (!(Active.Map || Active.Topic)) return
|
||||||
|
|
||||||
|
const onCanvas = e.target.tagName === 'BODY'
|
||||||
|
|
||||||
switch (e.which) {
|
switch (e.which) {
|
||||||
case 13: // if enter key is pressed
|
case 13: // if enter key is pressed
|
||||||
// prevent topic creation if sending a message
|
// prevent topic creation if sending a message
|
||||||
|
@ -28,7 +30,7 @@ const Listeners = {
|
||||||
JIT.escKeyHandler()
|
JIT.escKeyHandler()
|
||||||
break
|
break
|
||||||
case 65: // if a or A is pressed
|
case 65: // if a or A is pressed
|
||||||
if (e.ctrlKey || e.metaKey) {
|
if ((e.ctrlKey || e.metaKey) && onCanvas) {
|
||||||
Control.deselectAllNodes()
|
Control.deselectAllNodes()
|
||||||
Control.deselectAllEdges()
|
Control.deselectAllEdges()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue