@@ -143,6 +143,7 @@ the deck container.
ndx = parseInt($field.val(), 10);
if (!$[deck]('getOptions').countNested) {
+ if (ndx >= rootCounter) return false;
$.each($[deck]('getSlides'), function(i, $slide) {
if ($slide.data('rootIndex') === ndx) {
ndx = i + 1;
@@ -118,16 +118,25 @@ describe('Deck JS Quick Go-To', function() {
});
describe('countNested false', function() {
- it('should ignore nested slides when given a slide number', function() {
- loadFixtures('nesteds.html');
+ beforeEach(function() {
+ loadFixtures('nesteds.html');
$.deck('.slide', {
countNested: false
});
-
$.deck('showGoTo');
+ });
+
+ it('should ignore nested slides when given a slide number', function() {
$(defaults.selectors.gotoInput).val('4');
$(defaults.selectors.gotoForm).submit();
expect($.deck('getSlide')).toHaveId('after');
});
+
+ it('should respect top side of new slide range', function() {
+ $.deck('go', 0);
+ $(defaults.selectors.gotoInput).val('6');
+ $(defaults.selectors.gotoForm).submit();
+ expect($.deck('getSlide')).toHaveId('slide-0');
+ });
});
});
\ No newline at end of file