summaryrefslogtreecommitdiff
path: root/scripts/textanalysis.ui.js
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2014-11-11 13:20:39 +0200
committerAlon Levy <alon@pobox.com>2014-11-11 13:22:41 +0200
commitba92febfa94154936cd09ed139733a44c8719959 (patch)
tree8e77c0c251da5af14894e79ad4218df8d5dde4e1 /scripts/textanalysis.ui.js
parent6ee3190eba841c6e1888e8365dab84d329f453da (diff)
textanalysis: reduce API
textanalysis exposes the current selected type plus functions to increment or decrement it, hides the typeindex and nodetypes.
Diffstat (limited to 'scripts/textanalysis.ui.js')
-rw-r--r--scripts/textanalysis.ui.js6
1 files changed, 2 insertions, 4 deletions
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);