diff options
| author | Marcin Łabanowski <marcin@6irc.net> | 2013-01-02 07:59:24 +0100 |
|---|---|---|
| committer | Marcin Łabanowski <marcin@6irc.net> | 2013-01-02 07:59:24 +0100 |
| commit | e6e6ab039d1a70cf0f1f5d58d7b51d068bb3fe7c (patch) | |
| tree | bff5f42e487f110b2aea128946ab5aa107365d12 | |
| parent | 1768c3d389c67d37c016e4d24de546af582f9e4d (diff) | |
| parent | 839854ffc45c0426695912970bfdc9aa5dfac786 (diff) | |
Merge branch 'master' of github.com:vichan-devel/Tinyboard
| -rw-r--r-- | js/mobile-style.js | 16 | ||||
| -rw-r--r-- | js/smartphone-spoiler.js | 3 |
2 files changed, 10 insertions, 9 deletions
diff --git a/js/mobile-style.js b/js/mobile-style.js index 9a171da9..89e01b73 100644 --- a/js/mobile-style.js +++ b/js/mobile-style.js @@ -1,8 +1,8 @@ -onready(function(){ - if(navigator.userAgent.match(/iPhone|iPod|iPad|Android|Opera Mini|Blackberry|PlayBook|Windows Phone|Tablet PC|Windows CE|IEMobile/i)) { - $('html').addClass("mobile-style"); - } - else { - $('html').addClass("desktop-style"); - } -}) +if(navigator.userAgent.match(/iPhone|iPod|iPad|Android|Opera Mini|Blackberry|PlayBook|Windows Phone|Tablet PC|Windows CE|IEMobile/i)) { + $('html').addClass("mobile-style"); + device_type = "mobile"; +} +else { + $('html').addClass("desktop-style"); + device_type = "desktop"; +} diff --git a/js/smartphone-spoiler.js b/js/smartphone-spoiler.js index 54c7a9a1..67b9c789 100644 --- a/js/smartphone-spoiler.js +++ b/js/smartphone-spoiler.js @@ -6,12 +6,13 @@ * Copyright (c) 2012 Michael Save <savetheinternet@tinyboard.org> * * Usage: + * $config['additional_javascript'][] = 'js/mobile-style.js'; * $config['additional_javascript'][] = 'js/smartphone-spoiler.js'; * */ onready(function(){ - if(navigator.userAgent.match(/iPhone|iPod|iPad|Android|Opera Mini|Blackberry|PlayBook|Windows Phone|Tablet PC|Windows CE|IEMobile/i)) { + if(device_type == 'mobile') { var spoilers = document.getElementsByClassName('spoiler'); for(var i = 0; i < spoilers.length; i++) { spoilers[i].onmousedown = function() { |
