From e6889ecc099960ca66204d9eab8e4c6ccf0d89bc Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sat, 30 Jun 2012 13:22:51 +0200 Subject: removed debugging and check for TOC/sidebar exisance --- lib/tpl/dokuwiki/script.js | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'lib') diff --git a/lib/tpl/dokuwiki/script.js b/lib/tpl/dokuwiki/script.js index d32cf5cff..5badb5859 100644 --- a/lib/tpl/dokuwiki/script.js +++ b/lib/tpl/dokuwiki/script.js @@ -4,17 +4,23 @@ function tpl_dokuwiki_mobile(){ var $handle = jQuery('#dokuwiki__aside h3.toggle'); var $toc = jQuery('#dw__toc h3'); if(document.body.clientWidth > 979) { - console.log('desktop'); // reset for desktop mode - $handle[0].setState(1); - $handle.hide(); - $toc[0].setState(1); + if($handle.length) { + $handle[0].setState(1); + $handle.hide(); + } + if($toc.length) { + $toc[0].setState(1); + } } else { - console.log('mobile'); // toc and sidebar hiding - $handle.show(); - $handle[0].setState(-1); - $toc[0].setState(-1); + if($handle.length) { + $handle.show(); + $handle[0].setState(-1); + } + if($toc.length) { + $toc[0].setState(-1); + } } } -- cgit v1.2.3