Skip to content

Commit

Permalink
Merge pull request #7 from felipeng/feature-hide-show-menu-mobile
Browse files Browse the repository at this point in the history
added feature to show menu as default, without changing mobile view
  • Loading branch information
felipeng authored Apr 25, 2019
2 parents b23c024 + 79b6491 commit 15108e3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions data/config.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[wikilipe]
style = "lib/style/default.css"

; menu - "show" or "hide" menu as default
menu = "hide"
; menu_hidden - "yes" or "no"
menu_hidden = "no"

[highlightjs]
; custom languages: https://highlightjs.org/download/
Expand Down
6 changes: 2 additions & 4 deletions lib/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
$CONFIG = parse_ini_file("$DIR/config.ini", true);

// Configuration - wikilipe - menu (show/hide)
if ($CONFIG['wikilipe']['menu'] == "show") {
$CONFIG['wikilipe']['menu'] = "block";
} else {
$CONFIG['wikilipe']['menu'] = "none";
if ($CONFIG['wikilipe']['menu_hidden'] == "yes") {
$menu_hidden = "menu_hidden";
}

// do the image upload
Expand Down
4 changes: 2 additions & 2 deletions lib/page_tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<span id="nav-icon" onclick="goTop(); $('#menu').slideToggle('fast');">&#9776;</span>
<a href="?p=home"><img id="logo" src="lib/imgs/wikilipe.png"></a>
<a href="?p=home"><img id="logo_small" src="lib/imgs/wikilipe_small.png"></a>
<div id="page_path"><?php if(isset($PAGE_PATH)){ echo $PAGE_PATH;} ?></div>
<div id="page_path"><?php if(isset($PAGE_PATH)){ echo $PAGE_PATH; } ?></div>
<div id="form_search">
<form method="get" onsubmit="validate();">
<input id="search" type="text" name="search" value="" autocapitalize="none" autocorrect="off" placeholder="Search...">
Expand All @@ -37,7 +37,7 @@
</header>
<div id="content">
<textarea id="menu-text" style="display: none;"><?php echo $MENU; ?></textarea>
<nav id="menu" style="display: <?php echo $CONFIG['wikilipe']['menu']; ?>;"></nav>
<nav id="menu" class="<?php echo $menu_hidden; ?>"></nav>
<article>
<div id="page-edit" class="tab-page">
<form id="edit-toolbox" name="edit-toolbox" action="index.php" method="post">
Expand Down
5 changes: 3 additions & 2 deletions lib/style/default.css
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ footer {text-align: center; padding: 15px; font-size: 9pt; border-top: 1px solid

/* NAV */
nav{padding: 5px 10px 5px 10px; margin: 44px 10px 0px 0px; background-color: #fff; border: 1px solid #e8e8e8; overflow-y: scroll; max-width: 200px; min-width: 150px;}
.menu_hidden{display: none;}
nav a, .toc a{color: #444;}
nav a:hover, .toc a:hover{color: #039be5;}
nav ul{list-style-type:none; padding: 2px 2px 10px 5px; margin: 0px 0px 0px 0px;}
Expand Down Expand Up @@ -101,8 +102,8 @@ nav ul{list-style-type:none; padding: 2px 2px 10px 5px; margin: 0px 0px 0px 0px;
#tab-side{display: none;}
.tab:last-of-type{margin-right: 0px;}
.clipboard{display: none;}

nav{margin: 55px 5px -40px 5px; width: auto; overflow-y: hidden; min-width: none; max-width: none;}
.menu{display: none;}
nav{margin: 55px 5px -40px 5px; width: auto; overflow-y: hidden; min-width: none; max-width: none; display: none;}
article{padding-top: 0px; margin-top: 50px;}
.toc {position: unset; right: 0px; width: auto; border-left: 0px; max-height: none;}
.toc ul{display: none;}
Expand Down

0 comments on commit 15108e3

Please sign in to comment.