Browse Source

made sidebar inclusion more similar to core (hide it under more circumstances)

master
Anika Henke 9 years ago
parent
commit
76cda85575
  1. 8
      css/mobile.css
  2. 14
      css/structure.css
  3. 5
      main.php

8
css/mobile.css

@ -6,7 +6,7 @@
@media only screen and (max-width: 42em) {
.mode_show #dokuwiki__aside {
#dokuwiki__aside {
width: 100%;
float: none;
margin-bottom: 1.4em;
@ -15,15 +15,15 @@
margin: 0;
}
.mode_show #dokuwiki__content {
.hasSidebar #dokuwiki__content {
float: none;
margin-left: 0;
margin-right: 0;
}
.mode_show #dokuwiki__content > .pad {
.hasSidebar #dokuwiki__content > .pad {
margin-left: 0;
}
[dir=rtl] .mode_show #dokuwiki__content > .pad {
[dir=rtl] .hasSidebar #dokuwiki__content > .pad {
margin-right: 0;
}

14
css/structure.css

@ -50,17 +50,13 @@ body {
height: 1%;
}
/* show sidebar only in show mode */
#dokuwiki__aside {
display: none;
}
.mode_show #dokuwiki__aside {
width: __sidebar_width__;
float: left;
position: relative;
display: block;
}
[dir=rtl] .mode_show #dokuwiki__aside {
[dir=rtl] #dokuwiki__aside {
float: right;
}
#dokuwiki__aside > .pad {
@ -71,20 +67,20 @@ body {
}
/* make content wider when there's no sidebar */
.hasSidebar.mode_show #dokuwiki__content {
.hasSidebar #dokuwiki__content {
float: right;
margin-left: -__sidebar_width__;
width: 100%;
}
[dir=rtl] .hasSidebar.mode_show #dokuwiki__content {
[dir=rtl] .hasSidebar #dokuwiki__content {
float: left;
margin-left: 0;
margin-right: -__sidebar_width__;
}
.hasSidebar.mode_show #dokuwiki__content > .pad {
.hasSidebar #dokuwiki__content > .pad {
margin-left: __sidebar_width__;
}
[dir=rtl] .hasSidebar.mode_show #dokuwiki__content > .pad {
[dir=rtl] .hasSidebar #dokuwiki__content > .pad {
margin-left: 0;
margin-right: __sidebar_width__;
}

5
main.php

@ -11,6 +11,7 @@ if (!defined('DOKU_INC')) die(); /* must be run from within DokuWiki */
@require_once(dirname(__FILE__).'/tpl_functions.php'); /* include hook for template functions */
$showTools = !tpl_getConf('hideTools') || ( tpl_getConf('hideTools') && $_SERVER['REMOTE_USER'] );
$showSidebar = page_findnearest($conf['sidebar']) && ($ACT=='show');
?><!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $conf['lang'] ?>"
lang="<?php echo $conf['lang'] ?>" dir="<?php echo $lang['direction'] ?>" class="no-js">
@ -35,7 +36,7 @@ $showTools = !tpl_getConf('hideTools') || ( tpl_getConf('hideTools') && $_SERVER
see http://www.dokuwiki.org/devel:action_modes for a list of action modes */ ?>
<?php /* .dokuwiki should always be in one of the surrounding elements (e.g. plugins and templates depend on it) */ ?>
<div id="dokuwiki__site"><div id="dokuwiki__top"
class="dokuwiki site mode_<?php echo $ACT ?> <?php echo ($conf['sidebar']) ? 'hasSidebar' : '' ?>">
class="dokuwiki site mode_<?php echo $ACT ?> <?php echo ($showSidebar) ? 'hasSidebar' : '' ?>">
<?php html_msgarea() /* occasional error and info messages on top of the page */ ?>
<?php tpl_includeFile('header.html') ?>
@ -112,7 +113,7 @@ $showTools = !tpl_getConf('hideTools') || ( tpl_getConf('hideTools') && $_SERVER
<div class="wrapper">
<!-- ********** ASIDE ********** -->
<?php if ($conf['sidebar']): ?>
<?php if ($showSidebar): ?>
<div id="dokuwiki__aside"><div class="pad include">
<?php tpl_includeFile('sidebarheader.html') ?>
<?php tpl_include_page($conf['sidebar'], 1, 1) /* includes the nearest sidebar page */ ?>

Loading…
Cancel
Save