File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -143,6 +143,7 @@ the deck container.
143
143
ndx = parseInt ( $field . val ( ) , 10 ) ;
144
144
145
145
if ( ! $ [ deck ] ( 'getOptions' ) . countNested ) {
146
+ if ( ndx >= rootCounter ) return false ;
146
147
$ . each ( $ [ deck ] ( 'getSlides' ) , function ( i , $slide ) {
147
148
if ( $slide . data ( 'rootIndex' ) === ndx ) {
148
149
ndx = i + 1 ;
Original file line number Diff line number Diff line change @@ -118,16 +118,25 @@ describe('Deck JS Quick Go-To', function() {
118
118
} ) ;
119
119
120
120
describe ( 'countNested false' , function ( ) {
121
- it ( 'should ignore nested slides when given a slide number' , function ( ) {
122
- loadFixtures ( 'nesteds.html' ) ;
121
+ beforeEach ( function ( ) {
122
+ loadFixtures ( 'nesteds.html' ) ;
123
123
$ . deck ( '.slide' , {
124
124
countNested : false
125
125
} ) ;
126
-
127
126
$ . deck ( 'showGoTo' ) ;
127
+ } ) ;
128
+
129
+ it ( 'should ignore nested slides when given a slide number' , function ( ) {
128
130
$ ( defaults . selectors . gotoInput ) . val ( '4' ) ;
129
131
$ ( defaults . selectors . gotoForm ) . submit ( ) ;
130
132
expect ( $ . deck ( 'getSlide' ) ) . toHaveId ( 'after' ) ;
131
133
} ) ;
134
+
135
+ it ( 'should respect top side of new slide range' , function ( ) {
136
+ $ . deck ( 'go' , 0 ) ;
137
+ $ ( defaults . selectors . gotoInput ) . val ( '6' ) ;
138
+ $ ( defaults . selectors . gotoForm ) . submit ( ) ;
139
+ expect ( $ . deck ( 'getSlide' ) ) . toHaveId ( 'slide-0' ) ;
140
+ } ) ;
132
141
} ) ;
133
142
} ) ;
You can’t perform that action at this time.
0 commit comments