summaryrefslogtreecommitdiff
path: root/src/client/view
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2015-05-18 23:05:51 +0300
committerAlon Levy <alon@pobox.com>2015-05-18 23:05:51 +0300
commit419a72047a4165c30f6348a1dc4287f77d90a57e (patch)
tree714bb677e69ef7980d8f8fde289e33dc072dc1f7 /src/client/view
parentabcaac9094b957d9fe98a9c8466f0b0fee3fa17c (diff)
client/view/activity: clear on document change
Diffstat (limited to 'src/client/view')
-rw-r--r--src/client/view/activity.js8
1 files changed, 8 insertions, 0 deletions
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,
};