diff options
| author | Alon Levy <alon@pobox.com> | 2015-05-04 20:02:08 +0300 |
|---|---|---|
| committer | Alon Levy <alon@pobox.com> | 2015-05-04 20:02:08 +0300 |
| commit | 5565dc1b1421807f242d0e402895aecbd0749851 (patch) | |
| tree | 1b6bf70783f5771058dceb20f3c1076cd4c82719 /src/client/view/textanalyser_input.js | |
| parent | 630fc2c06e774806920ac8a5ec94bce1d49651e4 (diff) | |
client: update selected type prompt based on cursor
Diffstat (limited to 'src/client/view/textanalyser_input.js')
| -rw-r--r-- | src/client/view/textanalyser_input.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/client/view/textanalyser_input.js b/src/client/view/textanalyser_input.js index bf96db1b..89602008 100644 --- a/src/client/view/textanalyser_input.js +++ b/src/client/view/textanalyser_input.js @@ -74,6 +74,7 @@ function textanalyser_input(spec) { spec: spec, on_analysis__input: new Bacon.Bus(), on_analysis__output: new Bacon.Bus(), + on_cursor: new Bacon.Bus(), on_resize: new Bacon.Bus(), element: $(element_name), selectionStart: selectionStart, @@ -149,6 +150,9 @@ function textanalyser_input(spec) { e.preventDefault(); }); + ta.on_cursor.plug(element.asEventStream('input keyup click selectionchange').map(function() { + return selectionStart();}).skipDuplicates()); + ta.on_analysis__input.plug(element.asEventStream('input').map(current_value).map(function (val) { return update_element(val); })); |
