From ba92febfa94154936cd09ed139733a44c8719959 Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Tue, 11 Nov 2014 13:20:39 +0200 Subject: textanalysis: reduce API textanalysis exposes the current selected type plus functions to increment or decrement it, hides the typeindex and nodetypes. --- scripts/textanalysis.ui.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'scripts/textanalysis.ui.js') diff --git a/scripts/textanalysis.ui.js b/scripts/textanalysis.ui.js index 4c11fc84..a1802272 100644 --- a/scripts/textanalysis.ui.js +++ b/scripts/textanalysis.ui.js @@ -46,8 +46,7 @@ function textSelect(inp, s, e) { } function changeType(arg) { - var typeindex, - lastnode = textanalysis.lastnode(), + var lastnode = textanalysis.lastnode(), nodetype, id; @@ -56,8 +55,7 @@ function changeType(arg) { } else { id = lastnode.id; } - typeindex = (arg === 'up'? textanalysis.typeindex_next() : textanalysis.typeindex_prev()); - nodetype = textanalysis.nodetypes()[typeindex]; + nodetype = (arg === 'up'? textanalysis.selected_type_next() : textanalysis.selected_type_prev()); if (arg === 'up') { RZ.graph.editType(id, null, nodetype); -- cgit v1.3.1