From 079ce89a20e1843f8d9d93bf5f50156c2ce5aafc Mon Sep 17 00:00:00 2001 From: Philipp Schaefer Date: Thu, 7 Nov 2013 00:39:26 +0100 Subject: [PATCH] bugfix: broken playertracker layout - use popup instead of tooltip on desktop too (see #630) --- plugins/player-tracker.user.js | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/plugins/player-tracker.user.js b/plugins/player-tracker.user.js index 20be22a4..602907a3 100644 --- a/plugins/player-tracker.user.js +++ b/plugins/player-tracker.user.js @@ -299,13 +299,18 @@ window.plugin.playerTracker.drawData = function() { + ago(last.time, now) + ' ago
' + window.chat.getChatPortalName(last); // show previous data in tooltip - var minsAgo = '\t ago\t'; - if(evtsLength >= 2) - title += '
 
previous locations:
'; + if(evtsLength >= 2) { + title += '
 
previous locations:
' + + ''; + } for(var i = evtsLength - 2; i >= 0 && i >= evtsLength - 10; i--) { var ev = playerData.events[i]; - title += ago(ev.time, now) + minsAgo + window.chat.getChatPortalName(ev) + '
'; + title += '' + + '' + + ''; } + if(evtsLength >= 2) + title += '
' + ago(ev.time, now) + 'ago' + window.chat.getChatPortalName(ev) + '
'; // calculate the closest portal to the player var eventPortal = [] @@ -330,14 +335,8 @@ window.plugin.playerTracker.drawData = function() { // marker itself var icon = playerData.team === 'RESISTANCE' ? new plugin.playerTracker.iconRes() : new plugin.playerTracker.iconEnl(); var m; - if (typeof android !== 'undefined' && android) { - m = L.marker(gllfe(last), {icon: icon, referenceToPortal: closestPortal, opacity: absOpacity}); - m.bindPopup(title); - } else { - m = L.marker(gllfe(last), {title: title, icon: icon, referenceToPortal: closestPortal, opacity: absOpacity}); - // ensure tooltips are closed, sometimes they linger - m.on('mouseout', function() { $(this._icon).tooltip('close'); }); - } + m = L.marker(gllfe(last), {icon: icon, referenceToPortal: closestPortal, opacity: absOpacity}); + m.bindPopup(title); m.addTo(playerData.team === 'RESISTANCE' ? plugin.playerTracker.drawnTracesRes : plugin.playerTracker.drawnTracesEnl); plugin.playerTracker.oms.addMarker(m); // jQueryUI doesn’t automatically notice the new markers