Fix drill icons on marker medias

This commit is contained in:
2019-07-02 22:48:51 +02:00
parent 95ad05de26
commit d0ecd047ca
3 changed files with 90 additions and 67 deletions

View File

@@ -130,7 +130,7 @@ function initProject(sProjectCodeName){
self.tmp('proj_tz_notice', bSameTZ?'':' ('+self.vars(['project', 'timezone_desc'])+')');
$.when(
//Markers: Spot Messages & Pictures
//Markers: Spot Messages & Medias
self.get(
'markers',
function(){},
@@ -391,15 +391,16 @@ function initSpotMessages(aoMessages, aoTracks) {
.addIcon('fa-coords', false)
.append('Lat : '+oMsg.latitude+', Lng : '+oMsg.longitude));
//Tooltip pictures
//Tooltip medias
if(oMsg.medias) {
var $Pics = $('<div>', {'class':'pics'});
var $Medias = $('<div>', {'class':'medias'});
$.each(oMsg.medias, function(iKey, asMedia) {
var bVideo = (asMedia.subtype == 'video');
$Pics
$Medias
.append($('<a>', {
href: asMedia.pic_path,
'data-lightbox': 'marker-pictures',
'class': 'drill '+(bVideo?'video':'picture'),
href: asMedia.media_path,
'data-lightbox': 'marker-medias',
'data-video': (bVideo?'true':'false'),
'data-title': (bVideo?'Vidéo':'Photo')+' prise le '+asMedia.formatted_time+self.tmp('site_tz_notice'),
'data-orientation': asMedia.rotate})
@@ -407,7 +408,7 @@ function initSpotMessages(aoMessages, aoTracks) {
});
$Tooltip
.append($('<p>').addIcon('fa-picture').append('Photos'))
.append($Pics);
.append($Medias);
}
oMarker.bindPopup($Tooltip[0], {
@@ -418,7 +419,7 @@ function initSpotMessages(aoMessages, aoTracks) {
});
//Open tooltip on latest message in mobile mode
if(iKey === 0 && self.vars(['project', 'mode']) == self.consts.modes.blog && (!oMsg.pics || oMsg.pics.length < 3) && self.tmp('mobile')) oMarker.openPopup();
if(iKey === 0 && self.vars(['project', 'mode']) == self.consts.modes.blog && (!oMsg.medias || oMsg.medias.length < 3) && self.tmp('mobile')) oMarker.openPopup();
oSpot.tmp(['markers', oMsg.id_message], oMarker);
});
@@ -514,9 +515,9 @@ function getPost(asPost) {
var $Image = $('<img>', {'src': asPost.thumb_path, title: bVideo?'Click pour voir la vidéo':'Click pour zoomer'});
$Body = $('<a>', {
'class': 'drill '+(bVideo?'video':'picture'),
href: asPost.pic_path,
href: asPost.media_path,
'data-video': (bVideo?'true':'false'),
'data-lightbox': 'post-pictures',
'data-lightbox': 'post-medias',
'data-title': (bVideo?'Vidéo':'Photo')+' ajoutée le '+sAbsTime+sTakenOn, 'data-orientation': asPost.rotate
}).append($Image);
break;