@guardian/font-loader
Advanced tools
Comparing version 1.0.0-alpha to 1.0.0
10
index.js
@@ -14,3 +14,2 @@ const fetchFonts = (window, document) => { | ||
iframe.src = 'https://theguardian.com/font-loader'; | ||
iframe.classList = 'guardianFontLoader'; | ||
// add iframe and wait for message | ||
@@ -32,5 +31,12 @@ iframe.style.display = 'none'; | ||
}; | ||
loadFonts(); | ||
if (document.readyState === 'loading') { | ||
// Loading hasn't finished yet | ||
document.addEventListener('DOMContentLoaded', loadFonts); | ||
} else { | ||
// DOMContentLoaded has already fired | ||
loadFonts(); | ||
} | ||
}; | ||
export default fetchFonts; |
{ | ||
"name": "@guardian/font-loader", | ||
"version": "1.0.0-alpha", | ||
"version": "1.0.0", | ||
"description": "A script that inserts an iframe that points to the /font-loader endpoint on gu.com", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1513
37
2
1