From 999149895a5ed5c412cf4aa5f8bac3d95af69a29 Mon Sep 17 00:00:00 2001 From: fkloft Date: Sat, 30 Aug 2014 19:08:02 +0200 Subject: [PATCH] [portals-list] bugfix --- plugins/portals-list.user.js | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/plugins/portals-list.user.js b/plugins/portals-list.user.js index d3e26999..16050d41 100644 --- a/plugins/portals-list.user.js +++ b/plugins/portals-list.user.js @@ -356,20 +356,21 @@ window.plugin.portalslist.getPortalLink = function(portal) { var coord = portal.getLatLng(); var perma = '/intel?ll='+coord.lat+','+coord.lng+'&z=17&pll='+coord.lat+','+coord.lng; - //Use Jquery to create the link, which escape characters in TITLE of portal - return $('') - .text(portal.options.data.title) - .attr('href', perma) - .click(function(ev) { - renderPortalDetails(portal.options.guid); - ev.preventDefault(); - return false; - }) - .dblclick(function(ev) { - zoomToAndShowPortal(portal.options.guid, [coord.lat, coord.lng]); - ev.preventDefault(); - return false; - }); + // jQuery's event handlers seem to be removed when the nodes are remove from the DOM + var link = document.createElement("a"); + link.textContent = portal.options.data.title; + link.href = perma; + link.addEventListener("click", function(ev) { + renderPortalDetails(portal.options.guid); + ev.preventDefault(); + return false; + }, false); + link.addEventListener("dblclick", function(ev) { + zoomToAndShowPortal(portal.options.guid, [coord.lat, coord.lng]); + ev.preventDefault(); + return false; + }); + return link; } window.plugin.portalslist.onPaneChanged = function(pane) {