aboutsummaryrefslogtreecommitdiffstats
path: root/doc/toc.html
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2016-12-30 02:36:24 -0800
committerzotlabs <mike@macgirvin.com>2016-12-30 02:36:24 -0800
commit693f7366a2f8f4e7c4686e5701ff182da848dbb5 (patch)
treee2af1ea9dcae9e70979d67684776e3ca42eae27f /doc/toc.html
parente8a2ad43158bf94d55e64a23040c4a84a9414720 (diff)
parentc9cbd2f4f6cb432c6558bd88d783b356f0311a09 (diff)
downloadvolse-hubzilla-693f7366a2f8f4e7c4686e5701ff182da848dbb5.tar.gz
volse-hubzilla-693f7366a2f8f4e7c4686e5701ff182da848dbb5.tar.bz2
volse-hubzilla-693f7366a2f8f4e7c4686e5701ff182da848dbb5.zip
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge
Diffstat (limited to 'doc/toc.html')
-rw-r--r--doc/toc.html30
1 files changed, 26 insertions, 4 deletions
diff --git a/doc/toc.html b/doc/toc.html
index ba26d17e3..eeb0fe437 100644
--- a/doc/toc.html
+++ b/doc/toc.html
@@ -49,7 +49,8 @@
<div id="developers" class="panel-collapse collapse in">
<ul class="list-group">
<li class="doco-list-group-item"><a href="/help/developer/developer_guide">Guide</a></li>
- <li class="doco-list-group-item"><a href="/help/developer/api_zot">Zot Protocol and API</a></li>
+ <li class="doco-list-group-item"><a href="/help/developer/zot_protocol">Zot Protocol</a></li>
+ <li class="doco-list-group-item"><a href="/help/developer/api_zot">Zot API</a></li>
</ul>
</div>
</div>
@@ -67,7 +68,7 @@
</div>
</div>
<script>
-
+ toc = {};
// Generate the table of contents in the side nav menu (see view/tpl/help.tpl)
$(document).ready(function () {
$(".panel-collapse.in").find('a').each(function(){
@@ -88,8 +89,29 @@
}
});
- $(document.body).trigger("sticky_kit:recalc");
+ $(document.body).trigger("sticky_kit:recalc");
+
+ toc.contentTop = [];
+ toc.edgeMargin = 20; // margin above the top or margin from the end of the page
+ toc.topRange = 200; // measure from the top of the viewport to X pixels down
+ // Set up content an array of locations
+ $('#doco-side-toc').find('a').each(function(){
+ toc.contentTop.push( $( '#'+$(this).attr('href').split('#').pop() ).offset().top );
+ });
- });
+ // adjust side menu
+ $(window).scroll(function(){
+ var winTop = $(window).scrollTop(),
+ bodyHt = $(document).height(),
+ vpHt = $(window).height() + toc.edgeMargin; // viewport height + margin
+ $.each( toc.contentTop, function(i,loc){
+ if ( ( loc > winTop - toc.edgeMargin && ( loc < winTop + toc.topRange || ( winTop + vpHt ) >= bodyHt ) ) ){
+ $('#doco-side-toc li')
+ .removeClass('selected-doco-nav')
+ .eq(i).addClass('selected-doco-nav');
+ }
+ });
+ });
+ });
</script>