modified player tracker. show leaflet popup instead of tooltip on mobile
This commit is contained in:
parent
9a998b7a94
commit
154bf3c6ab
@ -295,16 +295,16 @@ window.plugin.playerTracker.drawData = function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
title += '\n'
|
title += '<br>'
|
||||||
+ ago(last.time, now) + ' ago\n'
|
+ ago(last.time, now) + ' ago<br>'
|
||||||
+ window.chat.getChatPortalName(last);
|
+ window.chat.getChatPortalName(last);
|
||||||
// show previous data in tooltip
|
// show previous data in tooltip
|
||||||
var minsAgo = '\t<span style="white-space: nowrap;"> ago</span>\t';
|
var minsAgo = '\t<span style="white-space: nowrap;"> ago</span>\t';
|
||||||
if(evtsLength >= 2)
|
if(evtsLength >= 2)
|
||||||
title += '\n \nprevious locations:\n';
|
title += '<br> <br>previous locations:<br>';
|
||||||
for(var i = evtsLength - 2; i >= 0 && i >= evtsLength - 10; i--) {
|
for(var i = evtsLength - 2; i >= 0 && i >= evtsLength - 10; i--) {
|
||||||
var ev = playerData.events[i];
|
var ev = playerData.events[i];
|
||||||
title += ago(ev.time, now) + minsAgo + window.chat.getChatPortalName(ev) + '\n';
|
title += ago(ev.time, now) + minsAgo + window.chat.getChatPortalName(ev) + '<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// calculate the closest portal to the player
|
// calculate the closest portal to the player
|
||||||
@ -330,6 +330,8 @@ window.plugin.playerTracker.drawData = function() {
|
|||||||
// marker itself
|
// marker itself
|
||||||
var icon = playerData.team === 'RESISTANCE' ? new plugin.playerTracker.iconRes() : new plugin.playerTracker.iconEnl();
|
var icon = playerData.team === 'RESISTANCE' ? new plugin.playerTracker.iconRes() : new plugin.playerTracker.iconEnl();
|
||||||
var m = L.marker(gllfe(last), {title: title, icon: icon, referenceToPortal: closestPortal, opacity: absOpacity});
|
var m = L.marker(gllfe(last), {title: title, icon: icon, referenceToPortal: closestPortal, opacity: absOpacity});
|
||||||
|
if (typeof android !== 'undefined' && android)
|
||||||
|
m.bindPopup(title);
|
||||||
// ensure tooltips are closed, sometimes they linger
|
// ensure tooltips are closed, sometimes they linger
|
||||||
m.on('mouseout', function() { $(this._icon).tooltip('close'); });
|
m.on('mouseout', function() { $(this._icon).tooltip('close'); });
|
||||||
m.addTo(playerData.team === 'RESISTANCE' ? plugin.playerTracker.drawnTracesRes : plugin.playerTracker.drawnTracesEnl);
|
m.addTo(playerData.team === 'RESISTANCE' ? plugin.playerTracker.drawnTracesRes : plugin.playerTracker.drawnTracesEnl);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user