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:
parent
ed3d3ae1e1
commit
5171a23a9c
9 changed files with 118 additions and 148 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue