From 5bb46a8acb2fba313d718cce8594ca81b5fcb6e2 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Sat, 24 May 2014 03:32:56 +0100 Subject: [PATCH] fix show-linked-portals plugin --- plugins/show-linked-portals.user.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/plugins/show-linked-portals.user.js b/plugins/show-linked-portals.user.js index 455a4fea..c354fb2e 100644 --- a/plugins/show-linked-portals.user.js +++ b/plugins/show-linked-portals.user.js @@ -45,14 +45,18 @@ window.plugin.showLinkedPortal.portalDetail = function (data) { var c = 1; - $(portalLinks.out).each(function () { - var portalInfo = window.plugin.showLinkedPortal.getPortalByGuid(this.otherPortalGuid, true); - $('#portaldetails').append(''); + $.each(portalLinks.out, function(index,linkGuid) { + // outgoing links - so the other portal is the destination + var otherPortalGuid = window.links[linkGuid].options.data.dGuid; + var portalInfo = window.plugin.showLinkedPortal.getPortalByGuid(otherPortalGuid, true); + $('#portaldetails').append(''); c = c + 1; }); - $(portalLinks.in).each(function () { - var portalInfo = window.plugin.showLinkedPortal.getPortalByGuid(this.otherPortalGuid, false); - $('#portaldetails').append(''); + $.each(portalLinks.in, function(index,linkGuid) { + // incoming link - so the other portal is the origin + var otherPortalGuid = window.links[linkGuid].options.data.oGuid; + var portalInfo = window.plugin.showLinkedPortal.getPortalByGuid(otherPortalGuid, false); + $('#portaldetails').append(''); c = c + 1; });