From 168a9bfb109a4a44c185fa5d9367f6e8aec6c279 Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Tue, 6 Jan 2015 22:34:38 +0200 Subject: client: fix tab switching; move to new tokenize implementation (not strictly ""right"" --- src/client/textanalysis.ui.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/client/textanalysis.ui.js') diff --git a/src/client/textanalysis.ui.js b/src/client/textanalysis.ui.js index a70746e3..2d51efb0 100644 --- a/src/client/textanalysis.ui.js +++ b/src/client/textanalysis.ui.js @@ -97,14 +97,16 @@ function textSelect(inp, s, e) { } function changeType(arg) { - var lastnode = textanalysis.lastnode(), + var lastnode = textanalysis.lastnode(rz_core.edit_graph), nodetype, - id; + id, + name; if (!lastnode) { - id = "new node"; + name = id = "new node"; } else { id = lastnode.id; + name = lastnode.name; } nodetype = (arg === 'up'? textanalysis.selected_type_next() : textanalysis.selected_type_prev()); @@ -117,6 +119,7 @@ function changeType(arg) { typeselection.showChosenType(nodetype); rz_core.edit_graph.findCoordinates(id); } + textanalysis.set_type(name, nodetype); } return { @@ -148,9 +151,9 @@ return { ret = false; break; case 9: //TAB - if (textanalysis.lastnode()) { + if (textanalysis.lastnode(rz_core.edit_graph)) { e.preventDefault(); - changeType(e.shiftKey ? "up" : "down", textanalysis.lastnode()); + changeType(e.shiftKey ? "up" : "down"); ret = false; } break; -- cgit v1.3.1