diff options
author | Paolo T <tuscanhobbit@users.noreply.github.com> | 2013-11-12 02:09:32 -0800 |
---|---|---|
committer | Paolo T <tuscanhobbit@users.noreply.github.com> | 2013-11-12 02:09:32 -0800 |
commit | 67a101452b82782114143dc0b5bdba15adc0ba99 (patch) | |
tree | 9daee3807b370d02ee4c28e6df7db08731fbb9f1 /js/main.js | |
parent | b23f3fc03b6bc751aab67fe2258a21f7c65bab8e (diff) | |
parent | 7cb4c2f8ad813336aafdec05e40f3a8eb1808d00 (diff) | |
download | volse-hubzilla-67a101452b82782114143dc0b5bdba15adc0ba99.tar.gz volse-hubzilla-67a101452b82782114143dc0b5bdba15adc0ba99.tar.bz2 volse-hubzilla-67a101452b82782114143dc0b5bdba15adc0ba99.zip |
Merge pull request #4 from friendica/master
Fork aligned to red master
Diffstat (limited to 'js/main.js')
-rw-r--r-- | js/main.js | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/js/main.js b/js/main.js index 79f11f424..a9e670da5 100644 --- a/js/main.js +++ b/js/main.js @@ -121,6 +121,7 @@ var page_load = true; var loadingPage = false; var pageHasMoreContent = true; + var updateCountsOnly = false; $(function() { $.ajaxSetup({cache: false}); @@ -269,21 +270,24 @@ } - // start live update + if(! updateCountsOnly) { + // start live update - if($('#live-network').length) { src = 'network'; liveUpdate(); } - if($('#live-channel').length) { src = 'channel'; liveUpdate(); } - if($('#live-community').length) { src = 'community'; liveUpdate(); } - if($('#live-display').length) { src = 'display'; liveUpdate(); } - if($('#live-search').length) { src = 'search'; liveUpdate(); } + if($('#live-network').length) { src = 'network'; liveUpdate(); } + if($('#live-channel').length) { src = 'channel'; liveUpdate(); } + if($('#live-community').length) { src = 'community'; liveUpdate(); } + if($('#live-display').length) { src = 'display'; liveUpdate(); } + if($('#live-search').length) { src = 'search'; liveUpdate(); } - if($('#live-photos').length) { - if(liking) { - liking = 0; - window.location.href=window.location.href + if($('#live-photos').length) { + if(liking) { + liking = 0; + window.location.href=window.location.href + } } } + updateCountsOnly = false; if(data.network == 0) { data.network = ''; @@ -576,6 +580,18 @@ function updateConvItems(mode,data) { updateConvItems(update_mode,data); $("#page-spinner").spin(false); $("#profile-jot-text-loading").spin(false); + + // FIXME - the following lines were added so that almost + // immediately after we update the posts on the page, we + // re-check and update the notification counts. + // As it turns out this causes a bit of an inefficiency + // as we're pinging twice for every update, once before + // and once after. A btter way to do this is to rewrite + // NavUpdate and perhpas LiveUpdate so that we check for + // post updates first and only call the notification ping + // once. + + updateCountsOnly = true; if(timer) clearTimeout(timer); timer = setTimeout(NavUpdate,10); }); |