We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a377cf2 commit f80a6bcCopy full SHA for f80a6bc
index.html
@@ -144,6 +144,7 @@
144
var fireflyField = new FireflyField(document.getElementById('firefly-field'));
145
146
ready(function() {
147
+ fireflyField.resize(window.innerWidth, window.innerHeight);
148
fireflyField.start();
149
});
150
scripts/utils.js
@@ -1,8 +1,14 @@
1
function ready(fn) {
2
+ var done = false;
3
+ function func() {
4
+ if (done) { return; }
5
+ done = false;
6
+ setTimeout(fn, 0);
7
+ }
8
if (document.readyState != 'loading') {
- fn();
9
+ func();
10
} else {
- document.addEventListener('DOMContentLoaded', fn);
11
+ document.addEventListener('DOMContentLoaded', func);
12
}
13
14
0 commit comments