From 959873b3cd6993255e3f49caee7437fbb3848271 Mon Sep 17 00:00:00 2001
From: weru <fromweru@gmail.com>
Date: Mon, 06 Mar 2023 07:19:27 +0000
Subject: [PATCH] fix icons loading recursively #95
---
assets/js/functions.js | 14 +++++---------
1 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/assets/js/functions.js b/assets/js/functions.js
index ae849b5..10f3f8f 100644
--- a/assets/js/functions.js
+++ b/assets/js/functions.js
@@ -172,15 +172,11 @@
}
}
-function loadSvg(file, parent, path = iconsPath) {
- const link = new URL(`${path}${file}.svg`, root_url).href;
- fetch(link)
- .then((response) => {
- return response.text();
- })
- .then((svg_data) => {
- parent.innerHTML = svg_data;
- });
+function loadSvg(icon, parent) {
+ parent.innerHTML = `
+ <svg class="icon_${icon}">
+ <use xlink:href="#${icon}"></use>
+ </svg>`;
}
function copyToClipboard(str) {
--
Gitblit v1.10.0