Fix message event in feed

This commit is contained in:
2026-01-16 21:46:51 +01:00
parent e7d4c840c2
commit b86d5d2cb1
2 changed files with 98 additions and 99 deletions

View File

@@ -4,6 +4,7 @@
import projectMediaLink from './projectMediaLink.vue';
import projectMapLink from './projectMapLink.vue';
import projectRelTime from './projectRelTime.vue';
import { LngLat } from 'maplibre-gl';
import autosize from 'autosize';
@@ -48,14 +49,14 @@
return '#'+[asHash.page, asHash.items[0], this.options.type, this.options.id].join(this.spot.consts.hash_sep);
},
modeHisto() {
return (this.project.mode==this.spot.consts.modes.histo);
return (this.project.currProject.mode==this.spot.consts.modes.histo);
},
relTime() {
return this.modeHisto?(this.options.formatted_time || '').substr(0, 10):this.options.relative_time;
},
},
inject: ['spot', 'project', 'user'],
inject: ['spot', 'project', 'user', 'map', 'project'],
methods: {
copyAnchor() {
copyTextToClipboard(this.spot.consts.server+this.spot.hash());
@@ -67,23 +68,12 @@
}, 5000);
},
panMapToMessage() {
//TODO
/*
var $Parent = $(oEvent.currentTarget).parent();
var oMarker = this.spot.tmp(['markers', $Parent.data('id')]);
if(this.isMobile()) {
this.toggleFeedPanel(false, 'panToInstant');
this.spot.tmp('map').setView(oMarker.getLatLng(), 15);
}
else {
var iOffset = (this.isFeedPanelOpen()?1:-1)*this.spot.tmp('$Feed').outerWidth(true)/2 - (this.isSettingsPanelOpen()?1:-1)*this.spot.tmp('$Settings').outerWidth(true)/2;
var iRatio = -1 * iOffset / $('body').outerWidth(true);
this.spot.tmp('map').setOffsetView(iRatio, oMarker.getLatLng(), 15);
}
$Parent.data('clicked', true);
if(!oMarker.isPopupOpen()) oMarker.openPopup();
*/
if(this.spot.isMobile()) this.project.toggleFeedPanel(false, 'panToInstant');
this.map.panTo(
new LngLat(this.options.longitude, this.options.latitude),
15,
() => {this.map.openMarkerPopup(this.options.id_message);}
);
},
openMarkerPopup() {
//TODO