From 5f435c7c8a6518abaea9fa2d6c52fe06b47a743f Mon Sep 17 00:00:00 2001 From: Thibaut Date: Sun, 6 Jul 2014 10:00:40 -0400 Subject: [PATCH] Don't app.init when document.body is null --- assets/javascripts/application.js.coffee | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/assets/javascripts/application.js.coffee b/assets/javascripts/application.js.coffee index 6990e0d1..ae85f852 100644 --- a/assets/javascripts/application.js.coffee +++ b/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