diff options
| author | Alon Levy <alon@pobox.com> | 2015-01-06 22:34:38 +0200 |
|---|---|---|
| committer | Alon Levy <alon@pobox.com> | 2015-01-06 22:34:38 +0200 |
| commit | 168a9bfb109a4a44c185fa5d9367f6e8aec6c279 (patch) | |
| tree | 5589a47f92f6a420ae995bbd85a397b87ea44701 /src/client/textanalysis.ui.js | |
| parent | ce130f4cae66a26d9b583d52309de2176803f78e (diff) | |
client: fix tab switching; move to new tokenize implementation (not strictly ""right""
Diffstat (limited to 'src/client/textanalysis.ui.js')
| -rw-r--r-- | src/client/textanalysis.ui.js | 13 |
1 files changed, 8 insertions, 5 deletions
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; |
