summaryrefslogtreecommitdiff
path: root/src/client/view/svg_input.js
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2015-03-12 00:33:53 +0200
committerAlon Levy <alon@pobox.com>2015-03-12 00:34:10 +0200
commit9e002baeb5e2770411e46b9dfd91e1bb26d4d668 (patch)
treedd669f0d144839196ad67f99b71db2638f0c51b0 /src/client/view/svg_input.js
parentad98e69a60a012f6ea065be80e660fdc29c178ed (diff)
client: use some more VK constants
Diffstat (limited to 'src/client/view/svg_input.js')
-rw-r--r--src/client/view/svg_input.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/client/view/svg_input.js b/src/client/view/svg_input.js
index db9e190e..1810d814 100644
--- a/src/client/view/svg_input.js
+++ b/src/client/view/svg_input.js
@@ -1,5 +1,5 @@
-define(['jquery', 'Bacon_wrapper', 'model/diff', 'rz_bus', 'consts'],
-function($, Bacon, model_diff, rz_bus, consts)
+define(['jquery', 'Bacon_wrapper', 'consts', 'model/diff', 'rz_bus', 'consts'],
+function($, Bacon, consts, model_diff, rz_bus, consts)
{
var svg_input_fo_node_y = '-.70em',
svg_input_fo_height = '30px';
@@ -65,10 +65,10 @@ var svgInput = function(vis, graph) {
console.log('unexpected editname_on_keypress this should be the svg-input element');
}
- if (e.which == 13 || e.which == 27) {
+ if (e.which == consts.VK_ENTER || e.which == consts.VK_ESCAPE) {
ret = false;
d = jelement.data().d;
- if (e.which == 13 && newname != d.name) {
+ if (e.which == consts.VK_ENTER && newname != d.name) {
if (d.hasOwnProperty('__src')) {
graph.update_link(d, {name: newname});
} else {