Do not load unnecessary script files (#4193)
This commit is contained in:
parent
87b96f8d33
commit
9008ab3407
5 changed files with 39 additions and 28 deletions
7
app/javascript/mastodon/ready.js
Normal file
7
app/javascript/mastodon/ready.js
Normal file
|
@ -0,0 +1,7 @@
|
|||
export default function ready(loaded) {
|
||||
if (['interactive', 'complete'].includes(document.readyState)) {
|
||||
loaded();
|
||||
} else {
|
||||
document.addEventListener('DOMContentLoaded', loaded);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue