From 41779d95775ac3f43eadd80ca1b125b9c9c6bced Mon Sep 17 00:00:00 2001 From: Azgaar Date: Wed, 24 Feb 2021 16:01:04 +0300 Subject: [PATCH] v1.5.54 - fixed 592 --- modules/save-and-load.js | 9 +++++++++ modules/ui/relief-editor.js | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/save-and-load.js b/modules/save-and-load.js index f471e8f3..eed28881 100644 --- a/modules/save-and-load.js +++ b/modules/save-and-load.js @@ -1086,6 +1086,15 @@ function parseLoadedData(data) { emblems.append("g").attr("id", "stateEmblems"); regenerateEmblems(); toggleEmblems(); + + // v 1.5 changed releif icons data + terrain.selectAll("use").each(function() { + const type = this.getAttribute("data-type") || this.getAttribute("xlink:href"); + this.removeAttribute("xlink:href"); + this.removeAttribute("data-type"); + this.removeAttribute("data-size"); + this.setAttribute("href", type); + }); } }() diff --git a/modules/ui/relief-editor.js b/modules/ui/relief-editor.js index 4ed05a4e..7cd2d1d2 100644 --- a/modules/ui/relief-editor.js +++ b/modules/ui/relief-editor.js @@ -54,7 +54,7 @@ function editReliefIcon() { } function updateReliefIconSelected() { - const type = elSelected.attr("href"); + const type = elSelected.attr("href") || elSelected.attr("data-type"); const button = reliefIconsDiv.querySelector("svg[data-type='"+type+"']"); reliefIconsDiv.querySelectorAll("svg.pressed").forEach(b => b.classList.remove("pressed"));