Created
February 9, 2016 23:00
-
-
Save w0rm/bd07d5a01fbe035b6273 to your computer and use it in GitHub Desktop.
Trigger elm-reactor build before loading elm.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
var img = new Image(); | |
img.onerror = function () { | |
var script = document.createElement('script'); | |
script.src = 'elm.js'; | |
script.onload = function () { | |
Elm.fullscreen(Elm.Main, { | |
locationHash: window.location.hash, | |
windowDimensions: [window.innerWidth, window.innerHeight] | |
}) | |
} | |
document.documentElement.appendChild(script); | |
} | |
img.src = 'Main.elm'; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment