Fix case for #58 where slide number entered is higher than countNested total but in legal range of actual slide count

This commit is contained in:
imakewebthings 2012-01-11 13:24:38 -08:00
parent d027a17fc6
commit 6118e3357a
2 changed files with 13 additions and 3 deletions

View file

@ -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;

View file

@ -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');
});
});
});