Skip to content

Commit

Permalink
make mobile javascript work correctly on orientation change
Browse files Browse the repository at this point in the history
  • Loading branch information
splitbrain committed Jun 29, 2012
1 parent 30fc91c commit ef7e36e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions 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);

0 comments on commit ef7e36e

Please sign in to comment.