diff options
author | Andreas Gohr <andi@splitbrain.org> | 2012-06-29 18:27:23 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2012-06-29 18:28:39 +0200 |
commit | ef7e36e4fd2a168977754f0aac1d855fb651f104 (patch) | |
tree | 4e000b77ee5c81aaee146aec4f6b71af00d517c5 | |
parent | 30fc91c71951c9911396de78b8acd7d6d4b5d54c (diff) | |
download | rpg-ef7e36e4fd2a168977754f0aac1d855fb651f104.tar.gz rpg-ef7e36e4fd2a168977754f0aac1d855fb651f104.tar.bz2 |
make mobile javascript work correctly on orientation change
-rw-r--r-- | lib/tpl/dokuwiki/script.js | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/tpl/dokuwiki/script.js b/lib/tpl/dokuwiki/script.js index b31d3dc08..75575608b 100644 --- a/lib/tpl/dokuwiki/script.js +++ b/lib/tpl/dokuwiki/script.js @@ -1,10 +1,14 @@ -jQuery(function(){ - // check if we are in mobile mode - if(jQuery('div.mobileTools').css('display') == 'none') return; +function tpl_dokuwiki_mobile(){ + // check if we are in mobile or tablet mode be sure to adjust the number + // here when adjusting it in the css + if(document.body.clientWidth > 979) return; // toc and sidebar hiding dw_page.makeToggle('#dokuwiki__aside h3.toggle','#dokuwiki__aside div.content'); jQuery('#dw__toc h3.toggle').click(); jQuery('#dokuwiki__aside h3.toggle').show().click(); -}); +} + +jQuery(tpl_dokuwiki_mobile); +jQuery(window).bind('resize',tpl_dokuwiki_mobile); |