Commit 8cbc2a8febf674c0d3f6e49a01fe9cf45f33e865
1 parent
21f23deb
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
#community dashboard - updating theme
Showing
1 changed file
with
9 additions
and
3 deletions
Show diff stats
plugins/community_hub/public/javascripts/community_hub.js
| @@ -243,6 +243,7 @@ function update_mediations() { | @@ -243,6 +243,7 @@ function update_mediations() { | ||
| 243 | type: 'get', | 243 | type: 'get', |
| 244 | data: { latest_post: latest_post_id, hub: hub_id }, | 244 | data: { latest_post: latest_post_id, hub: hub_id }, |
| 245 | success: function(data) { | 245 | success: function(data) { |
| 246 | + jQuery("body").removeClass("hub-loading"); | ||
| 246 | if (data.trim().length > 0) { | 247 | if (data.trim().length > 0) { |
| 247 | jQuery("#mediation-posts").prepend(data); | 248 | jQuery("#mediation-posts").prepend(data); |
| 248 | } | 249 | } |
| @@ -284,7 +285,7 @@ function update_live_stream(recursive) { | @@ -284,7 +285,7 @@ function update_live_stream(recursive) { | ||
| 284 | jQuery("#live-posts").scrollTop(live_scroll_position); | 285 | jQuery("#live-posts").scrollTop(live_scroll_position); |
| 285 | } | 286 | } |
| 286 | if (first_hub_load) { | 287 | if (first_hub_load) { |
| 287 | - jQuery("body").removeClass("loading"); | 288 | + jQuery("body").removeClass("hub-loading"); |
| 288 | first_hub_load = false; | 289 | first_hub_load = false; |
| 289 | } | 290 | } |
| 290 | } | 291 | } |
| @@ -316,10 +317,15 @@ function hub_right_tab_click() { | @@ -316,10 +317,15 @@ function hub_right_tab_click() { | ||
| 316 | jQuery("#right-tab").removeClass('hide'); | 317 | jQuery("#right-tab").removeClass('hide'); |
| 317 | jQuery("#right-tab").addClass('show'); | 318 | jQuery("#right-tab").addClass('show'); |
| 318 | jQuery(".hub #right-tab.show h1.live").click(hub_left_tab_click); | 319 | jQuery(".hub #right-tab.show h1.live").click(hub_left_tab_click); |
| 319 | - update_mediations(); | 320 | + if (first_mediations_load) { |
| 321 | + jQuery("body").addClass("hub-loading"); | ||
| 322 | + first_mediations_load = false; | ||
| 323 | + update_mediations(); | ||
| 324 | + } | ||
| 320 | } | 325 | } |
| 321 | 326 | ||
| 322 | first_hub_load = true; | 327 | first_hub_load = true; |
| 328 | +first_mediations_load = true; | ||
| 323 | 329 | ||
| 324 | jQuery(".hub .envelope").scroll(function() { | 330 | jQuery(".hub .envelope").scroll(function() { |
| 325 | jQuery("#auto_scrolling").attr('checked', false); | 331 | jQuery("#auto_scrolling").attr('checked', false); |
| @@ -354,7 +360,7 @@ jQuery(document).ready(function() { | @@ -354,7 +360,7 @@ jQuery(document).ready(function() { | ||
| 354 | 360 | ||
| 355 | jQuery(".hub #left-tab.show h1.mediation").click(hub_right_tab_click); | 361 | jQuery(".hub #left-tab.show h1.mediation").click(hub_right_tab_click); |
| 356 | 362 | ||
| 357 | - jQuery("body").addClass("loading"); | 363 | + jQuery("body").addClass("hub-loading"); |
| 358 | 364 | ||
| 359 | update_live_stream(true); | 365 | update_live_stream(true); |
| 360 | 366 |