fix auto update timer on histo projects
This commit is contained in:
@@ -28,6 +28,7 @@ oSpot.onSamePageMove = function(asHash) {
|
|||||||
self.tmp('map').remove();
|
self.tmp('map').remove();
|
||||||
self.tmp('$Map').empty();
|
self.tmp('$Map').empty();
|
||||||
self.tmp('map', null);
|
self.tmp('map', null);
|
||||||
|
setFeedUpdateTimer(false);
|
||||||
initProject(asHash.items[0]);
|
initProject(asHash.items[0]);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -213,8 +214,8 @@ function initSpotMessages(aoMessages, aoTracks) {
|
|||||||
var oElev = L.control.elevation({
|
var oElev = L.control.elevation({
|
||||||
collapsed: true,
|
collapsed: true,
|
||||||
position: "bottomright",
|
position: "bottomright",
|
||||||
width: $('#projects').width() - $('#feed').outerWidth(true) - $('.leaflet-bottom.leaflet-left').outerWidth(true) + 4,
|
width: $('#projects').width() - $('#feed').outerWidth(true) - $('.leaflet-bottom.leaflet-left').outerWidth(true) - 6,
|
||||||
height: 125,
|
height: 129,
|
||||||
hoverNumber: {
|
hoverNumber: {
|
||||||
decimalsX: 0, //distance (km)
|
decimalsX: 0, //distance (km)
|
||||||
decimalsY: 0 //elevation (m)
|
decimalsY: 0 //elevation (m)
|
||||||
@@ -386,12 +387,12 @@ function updateFeed(bFirstChunk, bDiscrete)
|
|||||||
|
|
||||||
if(bFirstChunk===true) {
|
if(bFirstChunk===true) {
|
||||||
self.tmp('news_chunk', 0);
|
self.tmp('news_chunk', 0);
|
||||||
$('#projects').removeClass('with-feed');
|
if(!bDiscrete) $('#projects').removeClass('with-feed');
|
||||||
}
|
}
|
||||||
|
|
||||||
self.get('feed', function(asData) {
|
self.get('feed', function(asData) {
|
||||||
$('#loading').hide();
|
$('#loading').hide();
|
||||||
$('#projects').addClass('with-feed');
|
if(!bDiscrete) $('#projects').addClass('with-feed');
|
||||||
|
|
||||||
$.each(asData, function(iKey, asPost){
|
$.each(asData, function(iKey, asPost){
|
||||||
$Posts.append(getPost(asPost));
|
$Posts.append(getPost(asPost));
|
||||||
@@ -416,7 +417,7 @@ function updateFeed(bFirstChunk, bDiscrete)
|
|||||||
function setFeedUpdateTimer(iSeconds, fCallback) {
|
function setFeedUpdateTimer(iSeconds, fCallback) {
|
||||||
fCallback = fCallback || function(){updateFeed(true);};
|
fCallback = fCallback || function(){updateFeed(true);};
|
||||||
if(typeof self.tmp('update_timer') != 'undefined') clearTimeout(self.tmp('update_timer'));
|
if(typeof self.tmp('update_timer') != 'undefined') clearTimeout(self.tmp('update_timer'));
|
||||||
self.tmp('update_timer', setTimeout(fCallback, iSeconds * 1000));
|
if(iSeconds > 0) self.tmp('update_timer', setTimeout(fCallback, iSeconds * 1000));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user