1
0
Эх сурвалжийг харах

Don't app.init when document.body is null

Thibaut 11 жил өмнө
parent
commit
5f435c7c8a

+ 5 - 1
assets/javascripts/application.js.coffee

@@ -20,6 +20,10 @@
 
 init = ->
   document.removeEventListener 'DOMContentLoaded', init, false
-  app.init()
+
+  if document.body
+    app.init()
+  else
+    setTimeout(init, 42)
 
 document.addEventListener 'DOMContentLoaded', init, false