Commit 24eb6750f60a45d51e3adc1ecb565e440fe3e62d
1 parent
8cbc2a8f
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
#community dashboard - updating theme
Showing
1 changed file
with
6 additions
and
1 deletions
Show diff stats
plugins/community_hub/public/javascripts/community_hub.js
... | ... | @@ -2,6 +2,7 @@ var latest_post_id = 0; |
2 | 2 | var oldest_post_id = 0; |
3 | 3 | live_scroll_position = 0; |
4 | 4 | var mediations = []; |
5 | +var message_interval_id; | |
5 | 6 | |
6 | 7 | function load_more(tab) { |
7 | 8 | switch (tab) { |
... | ... | @@ -89,6 +90,8 @@ function new_message(button) { |
89 | 90 | return false; |
90 | 91 | } |
91 | 92 | |
93 | + clearInterval( message_interval_id ); | |
94 | + | |
92 | 95 | var form = jQuery(button).parents("form"); |
93 | 96 | |
94 | 97 | jQuery(".hub .form-message .submit").attr("disabled", true); |
... | ... | @@ -101,9 +104,11 @@ function new_message(button) { |
101 | 104 | jQuery(".hub .form-message #message_body").val(''); |
102 | 105 | jQuery(".hub .form-message .submit").attr("disabled", false); |
103 | 106 | update_live_stream(false); |
107 | + message_interval_id = setInterval(function() { update_live_stream(false)}, 5000); | |
104 | 108 | } |
105 | 109 | else { |
106 | 110 | jQuery(".hub .form-message .submit").attr("disabled", false); |
111 | + message_interval_id = setInterval(function() { update_live_stream(false)}, 5000); | |
107 | 112 | } |
108 | 113 | }, 'json'); |
109 | 114 | |
... | ... | @@ -362,6 +367,6 @@ jQuery(document).ready(function() { |
362 | 367 | |
363 | 368 | jQuery("body").addClass("hub-loading"); |
364 | 369 | |
365 | - update_live_stream(true); | |
370 | + message_interval_id = setInterval(function() { update_live_stream(false) }, 5000); | |
366 | 371 | |
367 | 372 | }); | ... | ... |