Skip to content

Commit

Permalink
IVY-450 highlight current page in menu
Browse files Browse the repository at this point in the history
  • Loading branch information
twogee committed Dec 5, 2017
1 parent 0475cbd commit f5a7a5a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions asciidoc/style/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion asciidoc/templates/document.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions asciidoc/templates/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def link(printpage)

def relativeRoot()
p = ''
(self.id.split("/").length-1).times do |e|
(self.id.split("/").length - 1).times do |e|
p += '../'
end
return p
Expand Down Expand Up @@ -97,7 +97,7 @@ def menu()
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
Expand Down

0 comments on commit f5a7a5a

Please sign in to comment.