Optimize delta callbacks (new feed)
This commit is contained in:
@@ -551,13 +551,14 @@ class Spot extends Main
|
||||
}
|
||||
|
||||
//Sort Table IDs by type & Get attributes
|
||||
$asFeedIds = array('message'=>array(), 'media'=>array(), 'message'=>array());
|
||||
foreach($asItems as $asItem) {
|
||||
$asFeedIds[$asItem['type']][$asItem['id']] = $asItem;
|
||||
}
|
||||
$asFeedAttrs = array(
|
||||
'message' => $this->getSpotMessages(array_keys($asFeedIds['message'])),
|
||||
'media' => $this->getMedias($sMediaRefField, array_keys($asFeedIds['media'])),
|
||||
'post' => $this->getPosts(array_keys($asFeedIds['post']))
|
||||
'message' => empty($asFeedIds['message'])?array():$this->getSpotMessages(array_keys($asFeedIds['message'])),
|
||||
'media' => empty($asFeedIds['media'])?array():$this->getMedias($sMediaRefField, array_keys($asFeedIds['media'])),
|
||||
'post' => empty($asFeedIds['post'])?array():$this->getPosts(array_keys($asFeedIds['post']))
|
||||
);
|
||||
|
||||
//Replace Array Key with Item ID
|
||||
|
||||
@@ -776,6 +776,8 @@ function updateFeed(bFirstChunk, bDiscrete, fCallback) {
|
||||
|
||||
function focusOnPost(oFocusPost) {
|
||||
if(oFocusPost) {
|
||||
if(oFocusPost.type=='message' && (!oSpot.tmp(['markers', oFocusPost.id]) || !oSpot.tmp('map'))) setTimeout(function(){focusOnPost(oFocusPost);}, 100);
|
||||
else {
|
||||
var sElemId = '#'+oFocusPost.type+'-'+oFocusPost.id;
|
||||
var $Post = oSpot.tmp('$PostList').find(sElemId);
|
||||
var bGetToTop = (oSpot.tmp('$PostList').height() - (($Post.length > 0)?$Post.position().top:0) >= $(window).height());
|
||||
@@ -794,6 +796,7 @@ function focusOnPost(oFocusPost) {
|
||||
//Reset Hash
|
||||
oSpot.flushHash(['post', 'message']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getPost(asPost) {
|
||||
|
||||
@@ -25,4 +25,4 @@
|
||||
* Add mail frequency slider
|
||||
* Use WMTS servers directly when not using Geo Caching Server
|
||||
* Allow HEIF picture format
|
||||
* pbf map format (https://www.arcgis.com/home/item.html?id=7dc6cea0b1764a1f9af2e679f642f0f5)
|
||||
* Vector tiles support (https://www.arcgis.com/home/item.html?id=7dc6cea0b1764a1f9af2e679f642f0f5). Use Mapbox GL JS / Maplibre GL JS?
|
||||
@@ -531,7 +531,6 @@ $legend-color: $post-color;
|
||||
border-radius: $block-radius;
|
||||
background: $message-bg;
|
||||
color: $message-color;
|
||||
font-size: 1.2em;
|
||||
cursor: pointer;
|
||||
padding: $elem-spacing;
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user