mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-22 00:10:25 +01:00
wrapping findBootstrapEnvironment so that it doesn't run before the DOM is ready #2417
This commit is contained in:
@@ -256,20 +256,22 @@
|
|||||||
|
|
||||||
findBootstrapEnvironment: function() {
|
findBootstrapEnvironment: function() {
|
||||||
//http://stackoverflow.com/questions/14441456/how-to-detect-which-device-view-youre-on-using-twitter-bootstrap-api
|
//http://stackoverflow.com/questions/14441456/how-to-detect-which-device-view-youre-on-using-twitter-bootstrap-api
|
||||||
var envs = ['xs', 'sm', 'md', 'lg'],
|
$(document).ready(function() {
|
||||||
$el = $('<div>');
|
var envs = ['xs', 'sm', 'md', 'lg'],
|
||||||
|
$el = $('<div>');
|
||||||
|
|
||||||
$el.appendTo($('body'));
|
$el.appendTo($('body'));
|
||||||
|
|
||||||
for (var i = envs.length - 1; i >= 0; i--) {
|
for (var i = envs.length - 1; i >= 0; i--) {
|
||||||
var env = envs[i];
|
var env = envs[i];
|
||||||
|
|
||||||
$el.addClass('hidden-'+env);
|
$el.addClass('hidden-'+env);
|
||||||
if ($el.is(':hidden')) {
|
if ($el.is(':hidden')) {
|
||||||
$el.remove();
|
$el.remove();
|
||||||
return env;
|
return env;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
// get all the url params in a single key/value hash
|
// get all the url params in a single key/value hash
|
||||||
|
|||||||
Reference in New Issue
Block a user