diff options
| author | Alon Levy <alon@pobox.com> | 2015-05-18 23:05:51 +0300 |
|---|---|---|
| committer | Alon Levy <alon@pobox.com> | 2015-05-18 23:05:51 +0300 |
| commit | 419a72047a4165c30f6348a1dc4287f77d90a57e (patch) | |
| tree | 714bb677e69ef7980d8f8fde289e33dc072dc1f7 | |
| parent | abcaac9094b957d9fe98a9c8466f0b0fee3fa17c (diff) | |
client/view/activity: clear on document change
| -rw-r--r-- | src/client/rz_core.js | 1 | ||||
| -rw-r--r-- | src/client/view/activity.js | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/client/rz_core.js b/src/client/rz_core.js index 2e5363bd..9976384f 100644 --- a/src/client/rz_core.js +++ b/src/client/rz_core.js @@ -350,6 +350,7 @@ function rzdoc__open(rzdoc_name) { rz_config.rzdoc_cur__name = rzdoc_name; main_graph.clear(); edit_graph.clear(); + activity.clear(); main_graph.load_from_backend(on_success, on_error); } diff --git a/src/client/view/activity.js b/src/client/view/activity.js index d5744f24..c51eca77 100644 --- a/src/client/view/activity.js +++ b/src/client/view/activity.js @@ -192,6 +192,12 @@ function update_ago() _.each(activities, update_div_ago); } +function clear() +{ + activities.splice(0); // reset activities + activity_element.empty(); +} + function init(_graph, _graph_view, _graph_view_element) { incomingActivityBus.onValue(appendActivity); @@ -202,10 +208,12 @@ function init(_graph, _graph_view, _graph_view_element) $('.activity-fold-button').on('click', function() { activity_element.toggle(); }); + clear(); } return { init: init, + clear: clear, incomingActivityBus: incomingActivityBus, }; |
