@@ -121,14 +121,26 @@ const utils = (function () {
121121 let done
122122 $ . getJSON ( thingUrl , function ( data ) {
123123 if ( data . links . prev ) {
124- thingList . find ( '.thing-list-nav-prev' ) . attr ( 'href' , data . links . prev ) . css ( 'opacity' , 1 )
124+ thingList . find ( '.thing-list-nav-prev' ) . attr ( 'href' , data . links . prev ) . css ( {
125+ opacity : 1 ,
126+ 'pointer-events' : 'auto'
127+ } )
125128 } else {
126- thingList . find ( '.thing-list-nav-prev' ) . css ( 'opacity' , 0 )
129+ thingList . find ( '.thing-list-nav-prev' ) . css ( {
130+ opacity : 0 ,
131+ 'pointer-events' : 'none'
132+ } )
127133 }
128134 if ( data . links . next ) {
129- thingList . find ( '.thing-list-nav-next' ) . attr ( 'href' , data . links . next ) . css ( 'opacity' , 1 )
135+ thingList . find ( '.thing-list-nav-next' ) . attr ( 'href' , data . links . next ) . css ( {
136+ opacity : 1 ,
137+ 'pointer-events' : 'auto'
138+ } )
130139 } else {
131- thingList . find ( '.thing-list-nav-next' ) . css ( 'opacity' , 0 )
140+ thingList . find ( '.thing-list-nav-next' ) . css ( {
141+ opacity : 0 ,
142+ 'pointer-events' : 'none'
143+ } )
132144 }
133145 if ( data . meta . results . count === 0 ) {
134146 thingList . find ( '.thing-list-nav-page-info' ) . hide ( )
@@ -173,6 +185,7 @@ $(function () {
173185 thingList . find ( 'a.thing-list-nav-link' ) . on ( 'click' , function ( evt ) {
174186 evt . preventDefault ( )
175187 utils . loadThingList ( thingList , true , $ ( this ) . attr ( 'href' ) )
188+ $ ( window ) . scrollTop ( 0 )
176189 } )
177190
178191 utils . initThingList ( thingList )
0 commit comments