Fix hover events on message (feed)

This commit is contained in:
2026-01-17 00:57:07 +01:00
parent e70d3ddbd3
commit 4f3be3342c
2 changed files with 34 additions and 26 deletions

View File

@@ -27,7 +27,8 @@
timeDiff: (this.options.formatted_time && this.options.formatted_time_local != this.options.formatted_time),
anchorVisible: ['message', 'media', 'post'].includes(this.options.type),
anchorTitle: this.spot.lang('copy_to_clipboard'),
anchorIcon: 'link'
anchorIcon: 'link',
popupRequested: false
};
},
computed: {
@@ -54,6 +55,9 @@
relTime() {
return this.modeHisto?(this.options.formatted_time || '').substr(0, 10):this.options.relative_time;
},
lngLat() {
return (this.options.type == 'message')?(new LngLat(this.options.longitude, this.options.latitude)):null;
}
},
inject: ['spot', 'project', 'user', 'map', 'project'],
@@ -68,28 +72,20 @@
}, 5000);
},
panMapToMessage() {
this.popupRequested = true;
if(this.spot.isMobile()) this.project.toggleFeedPanel(false, 'panToInstant');
this.map.panTo(
new LngLat(this.options.longitude, this.options.latitude),
this.map.panToBetweenPanels(
this.lngLat,
15,
() => {this.map.openMarkerPopup(this.options.id_message);}
);
},
openMarkerPopup() {
//TODO
/*
let oMarker = this.spot.tmp(['markers', $(oEvent.currentTarget).data('id')]);
if(this.spot.tmp('map') && this.spot.tmp('map').getBounds().contains(oMarker.getLatLng()) && !oMarker.isPopupOpen()) oMarker.openPopup();
*/
if(this.map.isMarkerVisible(this.lngLat)) this.map.openMarkerPopup(this.options.id_message);
},
closeMarkerPopup() {
//TODO
/*
let $This = $(oEvent.currentTarget);
let oMarker = this.spot.tmp(['markers', $This.data('id')]);
if(oMarker && oMarker.isPopupOpen() && !$This.data('clicked')) oMarker.closePopup();
$This.data('clicked', false);
*/
if(!this.popupRequested) this.map.closeMarkerPopup();
this.popupRequested = false;
}
},
mounted() {