create new img instead of clone

This commit is contained in:
Zhora Shalyapin 2025-04-01 08:30:28 +00:00
parent facd974814
commit edd7268b7b

16
main.js
View File

@ -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
})
]
})