From 428a43116428140505d4225c0e6aef29fa058d7a Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Tue, 6 Jan 2015 16:05:06 -0500 Subject: [PATCH] Revert "wrapping findBootstrapEnvironment so that it doesn't run before the DOM is ready #2417" This reverts commit e42365f7c11e2ca10fac91ee58a733722aec87e8. --- public/src/utils.js | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/public/src/utils.js b/public/src/utils.js index 4f596c6092..a3f3be9648 100644 --- a/public/src/utils.js +++ b/public/src/utils.js @@ -256,22 +256,20 @@ findBootstrapEnvironment: function() { //http://stackoverflow.com/questions/14441456/how-to-detect-which-device-view-youre-on-using-twitter-bootstrap-api - $(document).ready(function() { - var envs = ['xs', 'sm', 'md', 'lg'], - $el = $('
'); + var envs = ['xs', 'sm', 'md', 'lg'], + $el = $('
'); - $el.appendTo($('body')); + $el.appendTo($('body')); - for (var i = envs.length - 1; i >= 0; i--) { - var env = envs[i]; + for (var i = envs.length - 1; i >= 0; i--) { + var env = envs[i]; - $el.addClass('hidden-'+env); - if ($el.is(':hidden')) { - $el.remove(); - return env; - } + $el.addClass('hidden-'+env); + if ($el.is(':hidden')) { + $el.remove(); + return env; } - }); + } }, // get all the url params in a single key/value hash