Inject SVG sprite via ajax (#10320)
* AJAX SVG * Fix PWA * Remove unused PWA assets Signed-off-by: jolheiser <john.olheiser@gmail.com> Co-Authored-by: silverwind <me@silverwind.io>
This commit is contained in:
parent
05c1f2b45c
commit
e76a64dda1
3 changed files with 11 additions and 4 deletions
|
@ -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]);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue