diff options
author | Anika Henke <anika@selfthinker.org> | 2012-09-25 20:25:54 +0100 |
---|---|---|
committer | Anika Henke <anika@selfthinker.org> | 2012-09-25 20:25:54 +0100 |
commit | 20391a36885910a616110df30f3ce30f8d23639d (patch) | |
tree | 389afb5a4ac24088182ef1e362acb81b1c626382 | |
parent | 07834a7c661d05ab5c707e1c428421c87af565bf (diff) | |
download | rpg-20391a36885910a616110df30f3ce30f8d23639d.tar.gz rpg-20391a36885910a616110df30f3ce30f8d23639d.tar.bz2 |
removed html dependency from media query detection JS in new template
-rw-r--r-- | lib/tpl/dokuwiki/css/mobile.css | 15 | ||||
-rw-r--r-- | lib/tpl/dokuwiki/main.php | 1 | ||||
-rw-r--r-- | lib/tpl/dokuwiki/script.js | 6 |
3 files changed, 8 insertions, 14 deletions
diff --git a/lib/tpl/dokuwiki/css/mobile.css b/lib/tpl/dokuwiki/css/mobile.css index cc61ab06c..ea32fb11d 100644 --- a/lib/tpl/dokuwiki/css/mobile.css +++ b/lib/tpl/dokuwiki/css/mobile.css @@ -5,18 +5,16 @@ * @author Anika Henke <anika@selfthinker.org> */ -/* for detecting media queries in JavaScript (see script.js): */ -#screen__mode { - position: relative; - z-index: 0; +body { + min-height: 0; /* for detecting media queries in JavaScript (see script.js): */ } /* up to 979px screen widths ********************************************************************/ @media only screen and (max-width: 979px) { -#screen__mode { - z-index: 1; /* for detecting media queries in JavaScript (see script.js) */ +body { + min-height: 1px; /* for detecting media queries in JavaScript (see script.js) */ } /* structure */ @@ -117,12 +115,9 @@ ********************************************************************/ @media only screen and (max-width: 480px) { -#screen__mode { - z-index: 2; /* for detecting media queries in JavaScript (see script.js) */ -} - body { font-size: 100%; + min-height: 2px; /* for detecting media queries in JavaScript (see script.js) */ } /*____________ structure ____________*/ diff --git a/lib/tpl/dokuwiki/main.php b/lib/tpl/dokuwiki/main.php index 6b1e95d62..2406a206b 100644 --- a/lib/tpl/dokuwiki/main.php +++ b/lib/tpl/dokuwiki/main.php @@ -91,7 +91,6 @@ $showSidebar = $hasSidebar && ($ACT=='show'); </div></div><!-- /site --> <div class="no"><?php tpl_indexerWebBug() /* provide DokuWiki housekeeping, required in all templates */ ?></div> - <div id="screen__mode" class="no"></div><?php /* helper to detect CSS media query in script.js */ ?></div> <!--[if ( lte IE 7 | IE 8 ) ]></div><![endif]--> </body> </html> diff --git a/lib/tpl/dokuwiki/script.js b/lib/tpl/dokuwiki/script.js index 3ed8dbabe..ec6e5285e 100644 --- a/lib/tpl/dokuwiki/script.js +++ b/lib/tpl/dokuwiki/script.js @@ -13,16 +13,16 @@ var device_classes = 'desktop mobile tablet phone'; function tpl_dokuwiki_mobile(){ // the z-index in mobile.css is (mis-)used purely for detecting the screen mode here - var screen_mode = jQuery('#screen__mode').css('z-index'); + var screen_mode = jQuery('body').css('min-height'); // determine our device pattern // TODO: consider moving into dokuwiki core switch (screen_mode) { - case '1': + case '1px': if (device_class.match(/tablet/)) return; device_class = 'mobile tablet'; break; - case '2': + case '2px': if (device_class.match(/phone/)) return; device_class = 'mobile phone'; break; |