summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2012-06-30 13:22:51 +0200
committerAndreas Gohr <andi@splitbrain.org>2012-06-30 13:22:51 +0200
commite6889ecc099960ca66204d9eab8e4c6ccf0d89bc (patch)
treec001383bf2a50ee677f88533b64309a35b970d09 /lib
parent688c5219ce1f6bf1dbda6e733bec881baaa24025 (diff)
downloadrpg-e6889ecc099960ca66204d9eab8e4c6ccf0d89bc.tar.gz
rpg-e6889ecc099960ca66204d9eab8e4c6ccf0d89bc.tar.bz2
removed debugging and check for TOC/sidebar exisance
Diffstat (limited to 'lib')
-rw-r--r--lib/tpl/dokuwiki/script.js22
1 files changed, 14 insertions, 8 deletions
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);
+ }
}
}