2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-06 09:10:25 +08:00

Re-apply with fixes: Stop using user agent to detect mobile devices. Use a media query and yepnope to load the appropriate css and customizations.

This commit is contained in:
Neil Lalonde 2013-12-11 11:17:55 -05:00
parent ed3d3ae1e1
commit 5171a23a9c
9 changed files with 118 additions and 148 deletions

View file

@ -5,7 +5,9 @@
var $buo = function() {
var badAndroid = false, ua = null;
var badAndroid = false,
haveJquery = (typeof($) !== 'undefined'),
ua = null;
// Sometimes we have to resort to parsing the user agent string. :(
if (navigator && navigator.userAgent) {
@ -53,6 +55,11 @@ var $buo = function() {
// shift the body down to make room for our notification div
document.body.style.marginTop = (div.clientHeight) + "px";
if (!haveJquery) {
var h = document.getElementsByTagName('html')[0];
h.className = h.className.replace(/(\s|^)css-loading(\s|$)/g, ' ');
}
};
$bu=$buo();