mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-04 01:34:27 +00:00 
			
		
		
		
	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:
		@@ -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]);
 | 
			
		||||
});
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user