diff options
| author | Alon Levy <alon@pobox.com> | 2015-03-07 22:06:29 +0200 |
|---|---|---|
| committer | Alon Levy <alon@pobox.com> | 2015-03-07 22:06:29 +0200 |
| commit | 51343360bad92228851c89454b077370e7499fbe (patch) | |
| tree | 89316f5a7df265d9892390996945d422de320c8e /src/client/textanalysis.ui.js | |
| parent | 40c0be6f4e1c0f596462c990a35cee4bee4ff55a (diff) | |
client: fix phantom type now that we have 4 types and not 5. Fixes #362
Diffstat (limited to 'src/client/textanalysis.ui.js')
| -rw-r--r-- | src/client/textanalysis.ui.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/client/textanalysis.ui.js b/src/client/textanalysis.ui.js index 02ba8b0f..e5d3f314 100644 --- a/src/client/textanalysis.ui.js +++ b/src/client/textanalysis.ui.js @@ -108,7 +108,8 @@ function analyzeSentence(spec) input_bus.push({where: consts.INPUT_WHERE_TEXTANALYSIS, input: sentence}); } -function changeType(arg) { +function changeType(up) +{ var lastnode = textanalysis.lastnode(rz_core.edit_graph, input.selectionStart()), nodetype, id, @@ -120,7 +121,7 @@ function changeType(arg) { id = lastnode.id; name = lastnode.name; } - nodetype = (arg === 'up'? textanalysis.selected_type_next() : textanalysis.selected_type_prev()); + nodetype = (up ? textanalysis.selected_type_next() : textanalysis.selected_type_prev()); rz_core.edit_graph.editType(id, nodetype); typeselection.showChosenType(id, nodetype); @@ -138,7 +139,7 @@ var main = function () }); input.on_type.onValue(function (up) { if (textanalysis.lastnode(rz_core.edit_graph, input.selectionStart())) { - changeType(up ? "up" : "down"); + changeType(up); ret = false; } }); |
