diff options
| author | Alon Levy <alon@pobox.com> | 2015-05-12 13:32:24 +0300 |
|---|---|---|
| committer | Alon Levy <alon@pobox.com> | 2015-05-12 13:32:32 +0300 |
| commit | 3b6bcd0ddef7077cc894a57597d09bf885a6bef3 (patch) | |
| tree | c0a09ab4514ad2ae1558ede8995d8a3a3288728a /src/client | |
| parent | 92c7303c37e46f8ecea8c016f63fea9516c3aa26 (diff) | |
client/view/activity: add hover highlight of links and nodes"
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/rz_core.js | 2 | ||||
| -rw-r--r-- | src/client/view/activity.js | 11 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/client/rz_core.js b/src/client/rz_core.js index 8255486e..8b18f975 100644 --- a/src/client/rz_core.js +++ b/src/client/rz_core.js @@ -207,7 +207,7 @@ function init() { init_graphs(); init_graph_views(); init_ws_connection(); - activity.init(main_graph, $('.graph-view')); + activity.init(main_graph, main_graph_view, $('.graph-view')); if (rz_config.backend_enabled) { var cur_rzdoc_name = rzdoc__current__get_name(); diff --git a/src/client/view/activity.js b/src/client/view/activity.js index 53706c06..4457a47f 100644 --- a/src/client/view/activity.js +++ b/src/client/view/activity.js @@ -4,13 +4,15 @@ function($, _, Bacon, selection) { var incomingActivityBus = new Bacon.Bus(), activity_element, graph_view_element, + graph_view, graph; -function init(_graph, _graph_view_element) +function init(_graph, _graph_view, _graph_view_element) { activity_element = $('<div class="activity-root-div"></div>'); graph_view_element = _graph_view_element; graph_view_element.append(activity_element); + graph_view = _graph_view; graph = _graph; } @@ -105,6 +107,13 @@ function appendActivity(diff) (event.shiftKey ? selection.invert_both : selection.select_both) (affected_nodes, affected_links); }); + new_div.hover(function (e) { + _.each(affected_nodes, graph_view.node__hover__start); + _.each(affected_links, graph_view.link__hover__start); + }, function (e) { + _.each(affected_nodes, graph_view.node__hover__end); + _.each(affected_links, graph_view.link__hover__end); + }); // TODO - x button // TODO - format of text per activity (topo/attr) // TODO - user data (requires protocol update?) |
