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.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.js')
| -rw-r--r-- | src/client/textanalysis.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/client/textanalysis.js b/src/client/textanalysis.js index 682b0b54..d44dfd06 100644 --- a/src/client/textanalysis.js +++ b/src/client/textanalysis.js @@ -11,6 +11,7 @@ var separator_string = rz_config.separator_string; var typeindex = 0, nodetypes = model_types.nodetypes, + nodetypes_count = nodetypes.length, default_nodetype = 'person', node_name_to_type = {}; @@ -623,11 +624,11 @@ return { }, selected_type_next: function() { - typeindex = (typeindex + 1) % 5; + typeindex = (typeindex + 1) % nodetypes_count; return selectedType(); }, selected_type_prev: function() { - typeindex = (typeindex + 4) % 5; + typeindex = (typeindex + nodetypes_count - 1) % nodetypes_count; return selectedType(); } }; |
