diff options
-rw-r--r-- | game.js | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -277,4 +277,11 @@ window.addEventListener("load", function() { openGame(); }); -window.addEventListener("resize", resizeHandler); +var resizeDebounceTimeout = null; +window.addEventListener("resize", function() { + if (resizeDebounceTimeout != null) return; + resizeDebounceTimeout = setTimeout(function() { + resizeDebounceTimeout = null; + resizeHandler(); + }, 50); +}); |