Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make mobile javascript work correctly on orientation change
- Loading branch information
1 parent
30fc91c
commit ef7e36e
Showing
1 changed file
with
8 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); |