From edd7268b7b2f71b11df36e86844d77a3a89851a4 Mon Sep 17 00:00:00 2001 From: Zhora Shalyapin Date: Tue, 1 Apr 2025 08:30:28 +0000 Subject: [PATCH] create new img instead of clone --- main.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/main.js b/main.js index 5229d56..af6248b 100644 --- a/main.js +++ b/main.js @@ -132,6 +132,10 @@ static a(params) { return this.make("a", params) } + + static img(params) { + return this.make("img", params) + } } class Property { @@ -384,7 +388,7 @@ } }, children: [ - Tag.make("img", { + Tag.img({ src: "https://upload.wikimedia.org/wikipedia/commons/a/aa/Bw_copy_icon_320x320.svg" }) ] @@ -419,7 +423,7 @@ } }, children: [ - Tag.make("img", { + Tag.img({ src: iconSrc, classes: "map-icon" }) @@ -909,10 +913,6 @@ }) for (const file of files) { - let swiperFile = file.cloneNode(true) - if (swiperFile.dataset.origin) - swiperFile.src = swiperFile.dataset.origin - let swiperSlide = Tag.div({ classes: "swiper-slide", children: [ @@ -922,7 +922,9 @@ text: "Скачать", target: "_blank" }), - swiperFile + Tag.img({ + src: file.dataset.origin + }) ] })