IVY-450 highlight current page in menu

This commit is contained in:
twogee 2017-09-03 08:33:35 +02:00
parent 7c06d662e2
commit 333deff496
3 changed files with 4 additions and 3 deletions

View File

@ -324,6 +324,7 @@ table.tableblock .valign-middle {
list-style-type: none;
padding-left: 22px;
margin-bottom: 3px;
color: #7a9438;
}
.treeview li.submenu {
background: white url('data:image/svg+xml;utf-8,<svg version="1.1" width="16px" height="16px" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><polygon points="2,2 14,2 8,14" fill="%237a9438"/></svg>') no-repeat left 1px;

View File

@ -28,7 +28,7 @@ html lang=(attr :lang, 'en' unless attr? :nolang)
link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css"
script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js" type="text/javascript"
javascript:
$(document).ready(function(){$("#treemenu").Treeview({speed: "fast",store: true});});
$(document).ready(function(){$("#treemenu").Treeview({speed: "fast",store: true});$("#xooki-" + $(location).attr('pathname').split('/').slice(-1 - ($("#xooki-index a").attr('href').match(/\.\./g) || []).length).join('--').replace(/\.html$/, '') + ' > a').css('color', '#9ebf47')});
hljs.initHighlightingOnLoad();
body
div id="body"

View File

@ -59,7 +59,7 @@ module IvyDocHelpers
def relativeRoot()
p = ''
(self.id.split("/").length-1).times do |e|
(self.id.split("/").length - 1).times do |e|
p += '../'
end
return p
@ -97,7 +97,7 @@ module IvyDocHelpers
def innermenu(page)
m = '<ul id="treemenu" class="treeview">' + "\n"
page.children.each do |p|
m += '<li id="xooki-' + (p.id || "undefined") + '"'
m += '<li id="xooki-' + (p.id.gsub(/\//, '--') || "undefined") + '"'
if p.children.length > 0
m += ' class="submenu"'
end