gab-social/app/javascript/gabsocial/ready.js

10 lines
212 B
JavaScript
Raw Normal View History

2019-07-02 08:10:25 +01:00
'use strict';
export default function ready(loaded) {
if (['interactive', 'complete'].includes(document.readyState)) {
loaded();
} else {
document.addEventListener('DOMContentLoaded', loaded);
}
}