debian-mirror-gitlab/app/views/layouts/_startup_css_activation.haml
2020-11-24 15:15:51 +05:30

10 lines
502 B
Text

- return unless use_startup_css?
= javascript_tag nonce: true do
:plain
document.querySelectorAll('link[media="print"]').forEach(linkTag => {
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});
})
- return unless use_startup_css?