js: start liveupdate after ping returns to stop continuos welcome message
As liveupdate start before ping but returns after, it overwrite session edit by ping, restoring already shown and deleted notices and infos
This commit is contained in:
parent
20217c04f0
commit
25b972bee2
1 changed files with 24 additions and 17 deletions
41
js/main.js
41
js/main.js
|
@ -168,28 +168,35 @@
|
|||
|
||||
function NavUpdate() {
|
||||
|
||||
if($('#live-network').length) { src = 'network'; liveUpdate(); }
|
||||
if($('#live-profile').length) { src = 'profile'; liveUpdate(); }
|
||||
if($('#live-community').length) { src = 'community'; liveUpdate(); }
|
||||
if($('#live-notes').length) { src = 'notes'; liveUpdate(); }
|
||||
if($('#live-display').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
|
||||
}
|
||||
}
|
||||
|
||||
if(! stopped) {
|
||||
$.get("ping",function(data) {
|
||||
$(data).find('result').each(function() {
|
||||
// send nav-update event
|
||||
$('nav').trigger('nav-update', this);
|
||||
|
||||
|
||||
// start live update
|
||||
|
||||
if($('#live-network').length) { src = 'network'; liveUpdate(); }
|
||||
if($('#live-profile').length) { src = 'profile'; liveUpdate(); }
|
||||
if($('#live-community').length) { src = 'community'; liveUpdate(); }
|
||||
if($('#live-notes').length) { src = 'notes'; liveUpdate(); }
|
||||
if($('#live-display').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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
}) ;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue