From f7dbf1759d3f9a578d8d84bda58bda7777ee7365 Mon Sep 17 00:00:00 2001 From: Andreas Gohr <andi@splitbrain.org> Date: Thu, 11 Dec 2014 20:21:44 +0100 Subject: [PATCH] scroll to current page when opening the sitemap --- inc/html.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/inc/html.php b/inc/html.php index 711cd8db6..cdcd166d9 100644 --- a/inc/html.php +++ b/inc/html.php @@ -937,8 +937,14 @@ function html_list_index($item){ * @return string html */ function html_li_index($item){ + global $INFO; + if($item['type'] == "f"){ - return '<li class="level'.$item['level'].'">'; + // scroll to the current item + if($item['id'] == $INFO['id']) { + $id = ' id="scroll__here"'; + } + return '<li class="level'.$item['level'].'" '.$id.'>'; }elseif($item['open']){ return '<li class="open">'; }else{ -- GitLab