From f2733c9d1406738769d8409e3d2b0d1ead0a6c22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20H=C3=B8gh?= Date: Wed, 22 Jun 2022 15:23:50 +0200 Subject: [PATCH] Some fixes regarding pop-ups and tables. Bug regarding links in pop-ups fixed --- browser/modules/layerTree/index.js | 4 +++- public/js/gc2/gc2table.js | 11 ++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/browser/modules/layerTree/index.js b/browser/modules/layerTree/index.js index 1bb0dad60..a510e3294 100644 --- a/browser/modules/layerTree/index.js +++ b/browser/modules/layerTree/index.js @@ -2002,7 +2002,9 @@ module.exports = { `).openOn(cloud.get().map) .on('remove', () => { sqlQuery.resetAll(); - _self.resetAllVectorLayerStyles(); + if (window.vidiConfig.crossMultiSelect) { + _self.resetAllVectorLayerStyles(); + } }); } } diff --git a/public/js/gc2/gc2table.js b/public/js/gc2/gc2table.js index 7a1abfa8e..8f3d4663d 100644 --- a/public/js/gc2/gc2table.js +++ b/public/js/gc2/gc2table.js @@ -256,6 +256,7 @@ var gc2table = (function () { var bindEvent = function (e) { setTimeout(function () { $(el + ' > tbody > tr').on("click", function (e) { + m.map.closePopup(); var id = $(this).data('uniqueid'); var databaseIdentifier = getDatabaseIdForLayerId(id); if (uncheckedIds.indexOf(databaseIdentifier) === -1 || checkBox === false) { @@ -422,14 +423,18 @@ var gc2table = (function () { data = []; $.each(store.layer._layers, function (i, v) { v.feature.properties._id = i; - $.each(v.feature.properties, function (n, m) { + + // Clone + let layerClone = jQuery.extend(true, {}, v.feature.properties); + $.each(layerClone, function (n, m) { $.each(cm, function (j, k) { if (k.dataIndex === n && ((typeof k.link === "boolean" && k.link === true) || (typeof k.link === "string"))) { - v.feature.properties[n] = "" + (typeof k.link === "string" ? k.link : "Link") + ""; + layerClone[n] = "" + (typeof k.link === "string" ? k.link : "Link") + ""; } }); }); - data.push(JSON.parse(JSON.stringify(v.feature.properties))); + data.push(JSON.parse(JSON.stringify(layerClone))); + layerClone = null; if (assignFeatureEventListenersOnDataLoad) { assignEventListeners();