@@ -242,19 +242,27 @@ $(function() {
242242 console . log ( 'genprevnext level 1' ) ;
243243
244244 $ ( '.content.visible .prevnextnav > div' ) . removeClass ( 'levelNN' ) ;
245- $ ( '.content.visible .prevnextnav > div' ) . removeClass ( 'levelN' ) ;
245+ $ ( '.content.visible .prevnextnav > div' ) . removeClass ( 'levelN' ) ;
246+ $ ( '.content.visible .prevnextnav.top > div' ) . removeClass ( 'levelNN' ) ;
247+ $ ( '.content.visible .prevnextnav.top > div' ) . removeClass ( 'levelN' ) ;
246248
247249 var nextsection = $ ( '.content.visible' ) . next ( )
248250 var nextsectionid = nextsection . attr ( 'internal-destination' ) ;
249251 var nextsectiontitle = nextsection . find ( '.section-title' ) . text ( ) ;
250252 if ( ! nextsectionid ) {
251253 $ ( '.content.visible .prevnextnav .next .nexttext' ) . text ( '' ) ;
252254 $ ( '.content.visible .prevnextnav .next' ) . css ( 'visibility' , 'hidden' ) ;
255+ $ ( '.content.visible .prevnextnav.top .next .nexttext' ) . text ( '' ) ;
256+ $ ( '.content.visible .prevnextnav.top .next' ) . css ( 'visibility' , 'hidden' ) ;
253257 } else {
254258 $ ( '.content.visible .prevnextnav .next .nexttext' ) . text ( nextsectiontitle ) ;
255259 $ ( '.content.visible .prevnextnav .next' ) . attr ( 'internal-destination' , nextsectionid ) ;
256260 $ ( '.content.visible .prevnextnav .next' ) . css ( 'visibility' , 'visible' ) ;
257261 $ ( '.content.visible .prevnextnav .next' ) . addClass ( 'levelN' ) ;
262+ $ ( '.content.visible .prevnextnav.top .next .nexttext' ) . text ( nextsectiontitle ) ;
263+ $ ( '.content.visible .prevnextnav.top .next' ) . attr ( 'internal-destination' , nextsectionid ) ;
264+ $ ( '.content.visible .prevnextnav.top .next' ) . css ( 'visibility' , 'visible' ) ;
265+ $ ( '.content.visible .prevnextnav.top .next' ) . addClass ( 'levelN' ) ;
258266 }
259267
260268 var prevsection = $ ( '.content.visible' ) . prev ( )
@@ -263,18 +271,26 @@ $(function() {
263271 if ( ! prevsectionid ) {
264272 $ ( '.content.visible .prevnextnav .prev .prevtext' ) . text ( '' ) ;
265273 $ ( '.content.visible .prevnextnav .prev' ) . css ( 'visibility' , 'hidden' ) ;
274+ $ ( '.content.visible .prevnextnav.top .prev .prevtext' ) . text ( '' ) ;
275+ $ ( '.content.visible .prevnextnav.top .prev' ) . css ( 'visibility' , 'hidden' ) ;
266276 } else {
267277 $ ( '.content.visible .prevnextnav .prev .prevtext' ) . text ( prevsectiontitle ) ;
268278 $ ( '.content.visible .prevnextnav .prev' ) . attr ( 'internal-destination' , prevsectionid ) ;
269279 $ ( '.content.visible .prevnextnav .prev' ) . css ( 'visibility' , 'visible' ) ;
270280 $ ( '.content.visible .prevnextnav .prev' ) . addClass ( 'levelN' ) ;
281+ $ ( '.content.visible .prevnextnav.top .prev .prevtext' ) . text ( prevsectiontitle ) ;
282+ $ ( '.content.visible .prevnextnav.top .prev' ) . attr ( 'internal-destination' , prevsectionid ) ;
283+ $ ( '.content.visible .prevnextnav.top .prev' ) . css ( 'visibility' , 'visible' ) ;
284+ $ ( '.content.visible .prevnextnav.top .prev' ) . addClass ( 'levelN' ) ;
271285 }
272286 }
273287
274288 //--------------------------------------------------------------------------------------------------------
275289 function genPrevNextLevelNN ( ) {
276290 $ ( '.content.visible .prevnextnav > div' ) . removeClass ( 'levelNN' ) ;
277291 $ ( '.content.visible .prevnextnav > div' ) . removeClass ( 'levelN' ) ;
292+ $ ( '.content.visible .prevnextnav.top > div' ) . removeClass ( 'levelNN' ) ;
293+ $ ( '.content.visible .prevnextnav.top > div' ) . removeClass ( 'levelN' ) ;
278294
279295 console . log ( 'genprevnext level 2' ) ;
280296 var nextchapter = $ ( '.chapters.visible' ) . next ( ) ;
@@ -287,16 +303,24 @@ $(function() {
287303 var nextsectiontitle = nextsection . find ( '.section-title' ) . text ( ) ;
288304 if ( ! nextsectionid ) { // the end
289305 $ ( '.content.visible .prevnextnav .next' ) . css ( 'visibility' , 'hidden' ) ;
306+ $ ( '.content.visible .prevnextnav.top .next' ) . css ( 'visibility' , 'hidden' ) ;
290307 } else {
291308 $ ( '.content.visible .prevnextnav .next' ) . attr ( 'internal-destination' , nextsectionid ) ;
292309 $ ( '.content.visible .prevnextnav .next' ) . addClass ( 'levelN' ) ;
293310 $ ( '.content.visible .prevnextnav .next .nexttext' ) . text ( nextsectiontitle ) ;
311+ $ ( '.content.visible .prevnextnav.top .next' ) . attr ( 'internal-destination' , nextsectionid ) ;
312+ $ ( '.content.visible .prevnextnav.top .next' ) . addClass ( 'levelN' ) ;
313+ $ ( '.content.visible .prevnextnav.top .next .nexttext' ) . text ( nextsectiontitle ) ;
294314 }
295315 } else {
296316 $ ( '.content.visible .prevnextnav .next .nexttext' ) . text ( nextchaptertitle ) ;
297317 $ ( '.content.visible .prevnextnav .next' ) . attr ( 'internal-destination' , nextchapterid ) ;
298318 $ ( '.content.visible .prevnextnav .next' ) . css ( 'visibility' , 'visible' ) ;
299319 $ ( '.content.visible .prevnextnav .next' ) . addClass ( 'levelNN' ) ;
320+ $ ( '.content.visible .prevnextnav.top .next .nexttext' ) . text ( nextchaptertitle ) ;
321+ $ ( '.content.visible .prevnextnav.top .next' ) . attr ( 'internal-destination' , nextchapterid ) ;
322+ $ ( '.content.visible .prevnextnav.top .next' ) . css ( 'visibility' , 'visible' ) ;
323+ $ ( '.content.visible .prevnextnav.top .next' ) . addClass ( 'levelNN' ) ;
300324 }
301325
302326 var prevchapter = $ ( '.chapters.visible' ) . prev ( )
@@ -309,11 +333,18 @@ $(function() {
309333 $ ( '.content.visible .prevnextnav .prev .prevtext' ) . text ( prevsectiontitle ) ;
310334 $ ( '.content.visible .prevnextnav .prev' ) . addClass ( 'levelN' ) ;
311335 $ ( '.content.visible .prevnextnav .prev' ) . attr ( 'internal-destination' , prevsectionid ) ;
336+ $ ( '.content.visible .prevnextnav.top .prev .prevtext' ) . text ( prevsectiontitle ) ;
337+ $ ( '.content.visible .prevnextnav.top .prev' ) . addClass ( 'levelN' ) ;
338+ $ ( '.content.visible .prevnextnav.top .prev' ) . attr ( 'internal-destination' , prevsectionid ) ;
312339 } else {
313340 $ ( '.content.visible .prevnextnav .prev .prevtext' ) . text ( prevchaptertitle ) ;
314341 $ ( '.content.visible .prevnextnav .prev' ) . attr ( 'internal-destination' , prevchapterid ) ;
315342 $ ( '.content.visible .prevnextnav .prev' ) . css ( 'visibility' , 'visible' ) ;
316343 $ ( '.content.visible .prevnextnav .prev' ) . addClass ( 'levelNN' ) ;
344+ $ ( '.content.visible .prevnextnav.top .prev .prevtext' ) . text ( prevchaptertitle ) ;
345+ $ ( '.content.visible .prevnextnav.top .prev' ) . attr ( 'internal-destination' , prevchapterid ) ;
346+ $ ( '.content.visible .prevnextnav.top .prev' ) . css ( 'visibility' , 'visible' ) ;
347+ $ ( '.content.visible .prevnextnav.top .prev' ) . addClass ( 'levelNN' ) ;
317348 }
318349 }
319350
0 commit comments