Skip to content

Commit ae7bcb0

Browse files
author
bcgwebdesign
committed
showing next/prev level N navigation
1 parent 652fa3c commit ae7bcb0

2 files changed

Lines changed: 27 additions & 3 deletions

File tree

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
<xsl:when test="title">
122122
<div class='section-title'>
123123
<h2>
124-
<xsl:if test="@id!='preface'">
124+
<xsl:if test="@id != 'preface' and @id != 'sec-glossary'">
125125
<xsl:value-of select="substring-after(@id,'sec')"/> -
126126
</xsl:if>
127127
<xsl:value-of select="normalize-space(title)"/>
@@ -154,8 +154,14 @@
154154
</xsl:otherwise>
155155
</xsl:choose>
156156
<div class='prevnextnav'>
157-
<div class='prev'>Prev</div>
158-
<div class='next'>Next</div>
157+
<div class='prev'>
158+
Prev
159+
<div class='prevtext'>ppp</div>
160+
</div>
161+
<div class='next'>
162+
Next
163+
<div class='nexttext'>nnn</div>
164+
</div>
159165
</div>
160166
</div>
161167
</xsl:template>

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ $(function() {
138138

139139
$('.tabs-nav nav.top-nav[internal-destination="' + id + '"]').addClass('selected');
140140
$('.tabs-nav nav.top-nav[internal-destination="' + id + '"] > a').addClass('selected');
141+
142+
genPrevNextLevelN();
141143
});
142144

143145

@@ -226,6 +228,22 @@ $(function() {
226228
});
227229
}
228230

231+
232+
function genPrevNextLevelN() {
233+
console.log('genprevnext');
234+
var nextsection=$('.content.visible').next()
235+
var nextsectionid=nextsection.attr('internal-destination');
236+
var nextsectiontitle=nextsection.find('.section-title').text();
237+
$('.content.visible .prevnextnav .next .nexttext').text(nextsectiontitle);
238+
239+
var prevsection=$('.content.visible').prev()
240+
var prevsectionid=prevsection.attr('internal-destination');
241+
var prevsectiontitle=prevsection.find('.section-title').text();
242+
$('.content.visible .prevnextnav .prev .prevtext').text(prevsectiontitle);
243+
}
244+
245+
246+
229247
function donav() {
230248
// search querystring for error param value
231249
var matches = window.location.search.match(/xref=([\w.]+)/);

0 commit comments

Comments
 (0)