Skip to content

Commit

Permalink
set level explicit to 1 for navbar option
Browse files Browse the repository at this point in the history
Fixes #267
  • Loading branch information
Klap-in committed Sep 17, 2023
1 parent 3a747b2 commit 2111827
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions syntax/indexmenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,11 @@ public function render($format, Doku_Renderer $renderer, $data) {
}
//Navbar with nojs
if($data[1]['navbar'] && !$data[6]['js']) {
if(!isset($data[0])) $data[0] = '..';
$data[6]['nss'][] = array(getNS($INFO['id']));
$renderer->info['cache'] = FALSE;
if(!isset($data[0])) {
$data[0] = '..';
}
$data[6]['nss'][] = [getNS($INFO['id']), 1]; //open only 1 level
$renderer->info['cache'] = false;
}

if($data[1]['context']) {
Expand All @@ -356,7 +358,7 @@ public function render($format, Doku_Renderer $renderer, $data) {
foreach($data[6]['nss'] as $key=> $value) {
$data[6]['nss'][$key][0] = $this->_parse_ns($value[0], $INFO['id']);
}
$renderer->info['cache'] = FALSE;
$renderer->info['cache'] = false;
}
$n = $this->_indexmenu($data);
if(!@$n) {
Expand Down Expand Up @@ -698,6 +700,8 @@ public function _search_index(&$data, $base, $file, $type, $lvl, $opts) {
$isopen = true;
} elseif(preg_match("/^".$nss[$a][0]."(:.*)/i", $id, $match)) {
//It's inside an optional namespace
// -1 is open all, otherwise count number of levels in the remainer of the pageid
// (match[0] is always prefixed with :)
if($nss[$a][1] == -1 || substr_count($match[1], ":") < $nss[$a][1]) {
$isopen = true;
} else {
Expand Down Expand Up @@ -970,4 +974,4 @@ private function _setorder($item) {
if($sort === false) $sort = noNS($item['id']);
return $sort;
}
} //Indexmenu class end
} //Indexmenu class end

0 comments on commit 2111827

Please sign in to comment.