Skip to content

Commit

Permalink
Some fixes regarding pop-ups and tables. Bug regarding links in pop-u…
Browse files Browse the repository at this point in the history
…ps fixed
  • Loading branch information
mapcentia committed Jun 22, 2022
1 parent e158e25 commit f2733c9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 3 additions & 1 deletion browser/modules/layerTree/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2002,7 +2002,9 @@ module.exports = {
</div>`).openOn(cloud.get().map)
.on('remove', () => {
sqlQuery.resetAll();
_self.resetAllVectorLayerStyles();
if (window.vidiConfig.crossMultiSelect) {
_self.resetAllVectorLayerStyles();
}
});
}
}
Expand Down
11 changes: 8 additions & 3 deletions public/js/gc2/gc2table.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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] = "<a style='text-decoration: underline' target='_blank' rel='noopener' href='" + v.feature.properties[n] + "'>" + (typeof k.link === "string" ? k.link : "Link") + "</a>";
layerClone[n] = "<a style='text-decoration: underline' target='_blank' rel='noopener' href='" + layerClone[n] + "'>" + (typeof k.link === "string" ? k.link : "Link") + "</a>";
}
});
});
data.push(JSON.parse(JSON.stringify(v.feature.properties)));
data.push(JSON.parse(JSON.stringify(layerClone)));
layerClone = null;

if (assignFeatureEventListenersOnDataLoad) {
assignEventListeners();
Expand Down

0 comments on commit f2733c9

Please sign in to comment.