From fa940341e39f0e8c75b4882922e30622370c12be Mon Sep 17 00:00:00 2001 From: Eashwar Ranganathan Date: Mon, 11 Feb 2013 02:45:27 -0800 Subject: [PATCH] Merge field GUIDs instead of overwriting them for portal field counts --- code/map_data.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/code/map_data.js b/code/map_data.js index 34f9dcc4..3145fba1 100644 --- a/code/map_data.js +++ b/code/map_data.js @@ -116,10 +116,15 @@ window.handleDataResponse = function(data, textStatus, jqXHR) { }); $.each(ppp, function(ind, portal) { - if(p2f[portal[0]] === undefined) + if(portal[2].portalV2['linkedFields'] === undefined) { portal[2].portalV2['linkedFields'] = []; - else - portal[2].portalV2['linkedFields'] = $.unique(p2f[portal[0]]); + } + if(p2f[portal[0]] !== undefined) { + $.merge(p2f[portal[0]], portal[2].portalV2['linkedFields']); + portal[2].portalV2['linkedFields'] = $.grep(p2f[portal[0]], function(v, i) { + return $.inArray(v, p2f[portal[0]]) === i; + }); + } }); $.each(ppp, function(ind, portal) { renderPortal(portal); });