debian-mirror-gitlab/app/views/layouts/_startup_css_activation.haml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

8 lines
423 B
Text
Raw Normal View History

2021-02-22 17:27:13 +05:30
= javascript_tag do
2020-10-24 23:57:45 +05:30
:plain
document.querySelectorAll('link[media="print"]').forEach(linkTag => {
2020-11-24 15:15:51 +05:30
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-10-24 23:57:45 +05:30
})