aboutsummaryrefslogtreecommitdiffstats
path: root/web_src/js/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'web_src/js/index.js')
-rw-r--r--web_src/js/index.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/web_src/js/index.js b/web_src/js/index.js
index 68fb4fddbc..2f2baddcfb 100644
--- a/web_src/js/index.js
+++ b/web_src/js/index.js
@@ -3581,3 +3581,12 @@ window.onOAuthLoginClick = function () {
oauthNav.show();
}, 5000);
};
+
+// Pull SVGs via AJAX to workaround CORS issues with <use> tags
+// https://css-tricks.com/ajaxing-svg-sprite/
+$.get(`${window.config.StaticUrlPrefix}/img/svg/icons.svg`, (data) => {
+ const div = document.createElement('div');
+ div.style.display = 'none';
+ div.innerHTML = new XMLSerializer().serializeToString(data.documentElement);
+ document.body.insertBefore(div, document.body.childNodes[0]);
+});