From 51343360bad92228851c89454b077370e7499fbe Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Sat, 7 Mar 2015 22:06:29 +0200 Subject: client: fix phantom type now that we have 4 types and not 5. Fixes #362 --- src/client/textanalysis.ui.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/client/textanalysis.ui.js') 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; } }); -- cgit v1.3.1