From 274c9a48926111ab71660eb948ddef7d51aa41db Mon Sep 17 00:00:00 2001 From: twogee Date: Sun, 3 Sep 2017 08:33:35 +0200 Subject: [PATCH] IVY-450 highlight current page in menu --- asciidoc/style/style.css | 1 + asciidoc/templates/document.html.slim | 2 +- asciidoc/templates/helpers.rb | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/asciidoc/style/style.css b/asciidoc/style/style.css index aeedf0404..1507b02f4 100644 --- a/asciidoc/style/style.css +++ b/asciidoc/style/style.css @@ -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,') no-repeat left 1px; diff --git a/asciidoc/templates/document.html.slim b/asciidoc/templates/document.html.slim index 4073a9cb8..f54a4b943 100644 --- a/asciidoc/templates/document.html.slim +++ b/asciidoc/templates/document.html.slim @@ -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" diff --git a/asciidoc/templates/helpers.rb b/asciidoc/templates/helpers.rb index 038f7f3d8..460f0607c 100644 --- a/asciidoc/templates/helpers.rb +++ b/asciidoc/templates/helpers.rb @@ -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 @@ -97,7 +97,7 @@ def menu() def innermenu(page) m = '