From 26bf7571c74dfdc587acba51c0396d2b48ca1b43 Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Sun, 11 Dec 2016 17:04:33 -0500 Subject: [PATCH] esc cancels topic and synapse creation now --- frontend/src/Metamaps/Create.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/frontend/src/Metamaps/Create.js b/frontend/src/Metamaps/Create.js index 7c3c4ff3..a83111a8 100644 --- a/frontend/src/Metamaps/Create.js +++ b/frontend/src/Metamaps/Create.js @@ -140,7 +140,13 @@ const Create = { }, newTopic: { init: function() { - $('#topic_name').keyup(function() { + $('#topic_name').keyup(function(e) { + const ESC = 27 + + if (e.keyCode === ESC) { + Create.newTopic.hide() + } // if + Create.newTopic.name = $(this).val() }) @@ -308,6 +314,7 @@ const Create = { e.keyCode === ESC) { Create.newSynapse.hide() } // if + Create.newSynapse.description = $(this).val() })