diff options
| -rw-r--r-- | scripts/textanalysis.js | 12 | ||||
| -rw-r--r-- | scripts/textanalysis.ui.js | 6 |
2 files changed, 7 insertions, 11 deletions
diff --git a/scripts/textanalysis.js b/scripts/textanalysis.js index 99286e00..cc1f2602 100644 --- a/scripts/textanalysis.js +++ b/scripts/textanalysis.js @@ -445,15 +445,13 @@ return { //for the external arrow-type changer lastnode: function() { return lastnode; }, - typeindex: function() { return typeindex; }, - typeindex_next: function() { + selected_type_next: function() { typeindex = (typeindex + 1) % 5; - return typeindex; + return selectedType(); }, - typeindex_prev: function() { + selected_type_prev: function() { typeindex = (typeindex + 4) % 5; - return typeindex; - }, - nodetypes: function() { return nodetypes; } // XXX should be readonly, but returning a copy? + return selectedType(); + } }; }); 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); |
