Skip to content

Commit 0febb60

Browse files
author
bcgwebdesign
committed
number and nav on in-this-chapter elements too
1 parent 1d8c553 commit 0febb60

3 files changed

Lines changed: 18 additions & 2 deletions

File tree

themes/doi-theme/assets/sass/partials/_handbook.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@
5252
&.alpha {
5353
list-style-type:lower-alpha;
5454
}
55+
&.chapter-list {
56+
list-style-type:none;
57+
li {
58+
cursor:pointer;
59+
}
60+
}
5561
}
5662

5763
.prevnextnav {

themes/doi-theme/static/data/handbook-html.xslt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,16 @@
139139
<xsl:if test="$sectiontitle!='Preface'">
140140
<div>
141141
<h4>In this chapter</h4>
142-
<ul>
142+
<ul class='chapter-list'>
143143
<xsl:for-each select="section">
144144
<li>
145+
<xsl:attribute name="internal-destination">
146+
<xsl:value-of select="@id"/>
147+
</xsl:attribute>
148+
<xsl:if test="@id != 'preface' and @id != 'sec-glossary'">
149+
<xsl:value-of select="substring-after(@id,'sec')"/>
150+
<xsl:text>&#xA0;</xsl:text>
151+
</xsl:if>
145152
<xsl:value-of select="title"/>
146153
</li>
147154
</xsl:for-each>

themes/doi-theme/static/js/script.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,13 @@ $(function() {
147147

148148

149149
// and this one for the left sub navs.
150-
$('#handbook-holder').on('click', '.tabs-nav nav.sub-nav > a',function(e) {
150+
$('#handbook-holder').on('click', '.tabs-nav nav.sub-nav > a, ul.chapter-list li',function(e) {
151151
fixFootnotes();
152152
const nav_elements = $('.tabs-nav nav.sub-nav > a');
153153
var id=$(this).closest('nav').attr('internal-destination');
154+
if (!id) {
155+
id = $(this).attr('internal-destination');
156+
}
154157
console.log("sub nav ID = " + id);
155158

156159
// hide everything else

0 commit comments

Comments
 (0)