diff --git a/inc/Feed.php b/inc/Feed.php index c031c92..ce6b948 100644 --- a/inc/Feed.php +++ b/inc/Feed.php @@ -237,11 +237,14 @@ class Feed extends PhpObject { $sWeatherCond = $asWeather['currentConditions']['conditions']; $sWeatherTemp = $asWeather['currentConditions']['temp']; } - else { //Daily Conditions + elseif($asWeather['days'][0]['icon'] != '') { //Daily Conditions $sWeatherIcon = $asWeather['days'][0]['icon']; $sWeatherCond = $asWeather['days'][0]['conditions']; $sWeatherTemp = $asWeather['days'][0]['temp']; } + else { + $sWeatherIcon = 'unknown'; + } //Get Condition ID $sCondKey = (new Translator(self::WEATHER_PARAM['lang']))->getTranslationKey($sWeatherCond); diff --git a/masks/project.html b/masks/project.html index b21a3ed..2eb1c54 100644 --- a/masks/project.html +++ b/masks/project.html @@ -624,7 +624,7 @@ function addSpotMessages(aoMessages) { } //Weather - if(oMsg.weather_icon) { + if(oMsg.weather_icon && oMsg.weather_icon!='unknown') { $Tooltip.append($('

', {'class':'weather', 'title':oSpot.lang(oMsg.weather_cond)}) .addIcon('fa-'+oMsg.weather_icon+' fa-fw fa-lg', true) .append(oMsg.weather_temp+'°C') @@ -780,10 +780,12 @@ function focusOnPost(oFocusPost) { var $Post = oSpot.tmp('$PostList').find(sElemId); var bGetToTop = (oSpot.tmp('$PostList').height() - (($Post.length > 0)?$Post.position().top:0) >= $(window).height()); if($Post.length > 0 && (bGetToTop || self.tmp('out-of-data'))) { - self.tmp('simple-bar').getScrollElement().scrollTop = - parseInt($Post.position().top) + + self.tmp('simple-bar').getScrollElement().scrollTop = Math.round( + $Post.position().top + parseInt($Post.css('margin-top')) + - (self.tmp('$Poster').is(':visible')?self.tmp('$Poster').outerHeight(true):0); + (self.tmp('$Poster').is(':visible')?self.tmp('$Poster').outerHeight(true):0) + ); + if(oFocusPost.type=='media' || oFocusPost.type=='message') $Post.find('a.drill').click(); } else if(!self.tmp('out-of-data')) updateFeed(false, false, function() {focusOnPost(oFocusPost);}); @@ -820,7 +822,7 @@ function getPost(asPost) { .append($('

').addIcon('fa-time', true).append(sAbsTime)) .append(bTimeDiff?$('

').addIcon('fa-timezone', true).append(oSpot.lang('local_time', sAbsTimeLocal)):'') .append($('', {'class':'drill'}) - .append((!asPost.weather_icon)?'':$('', {'class':'weather', 'title':oSpot.lang(asPost.weather_cond)}).addIcon('fa-'+asPost.weather_icon, true).append(asPost.weather_temp+'°C')) + .append((!asPost.weather_icon || asPost.weather_icon=='unknown')?'':$('', {'class':'weather', 'title':oSpot.lang(asPost.weather_cond)}).addIcon('fa-'+asPost.weather_icon, true).append(asPost.weather_temp+'°C')) .append($('', {'class':'staticmap', title: oSpot.lang('click_zoom'), src: getWmtsApiUrl('static', asPost.latitude, asPost.longitude, 13)})) .append($('', {'class': 'drill-icon fa-stack'}) .addIcon('fa-message fa-stack-2x')