2020-08-20 09:09:55 +00:00
|
|
|
- return unless use_startup_css?
|
|
|
|
|
2020-11-26 18:09:18 +00:00
|
|
|
= javascript_tag do
|
2020-08-20 09:09:55 +00:00
|
|
|
:plain
|
|
|
|
document.querySelectorAll('link[media="print"]').forEach(linkTag => {
|
2020-09-09 00:08:42 +00:00
|
|
|
linkTag.setAttribute('data-startupcss', 'loading');
|
|
|
|
const startupLinkLoadedEvent = new CustomEvent('CSSStartupLinkLoaded');
|
|
|
|
linkTag.addEventListener('load',function(){this.media='all';this.setAttribute('data-startupcss', 'loaded');document.dispatchEvent(startupLinkLoadedEvent);},{once: true});
|
2020-08-20 09:09:55 +00:00
|
|
|
})
|