|
23 | 23 | navItemNext: '<button class="' + namespace + '-nav" role="presentation">Show next slide</button>',
|
24 | 24 | counter: '<div class="' + namespace + '-counter" aria-hidden="true" role="presentation">%current% of %total%</div>',
|
25 | 25 | handleContainer: '<div class="' + namespace + '-handles" aria-hidden="true" role="presentation" />',
|
26 |
| - handleItem: '<button class="' + namespace + '-handle" role="presentation">Slide %index%</div>' |
| 26 | + handleItem: '<button class="' + namespace + '-handle" role="presentation">%index%</div>' |
27 | 27 | },
|
28 | 28 | stateClasses: {
|
29 | 29 | isInitialized: 'is-initialized',
|
|
263 | 263 | }, this));
|
264 | 264 | }
|
265 | 265 |
|
266 |
| - // Sync with other carousels |
267 |
| - if (this.settings.$syncedCarousels) { |
268 |
| - this.$dom.container.on(utils.getNamespacedEvents(syncEvent), $.proxy(function(event, params) { |
269 |
| - this.goTo(params.index, false, true); |
270 |
| - }, this)); |
271 |
| - } |
272 |
| - |
273 | 266 | // Save instance to data attribute
|
274 | 267 | $dom.container.data(namespace, this);
|
275 | 268 |
|
|
416 | 409 | setTimeout(function() {
|
417 | 410 | self.$dom.frame.scrollLeft(scrollLeft);
|
418 | 411 |
|
419 |
| - self.goTo(index); |
| 412 | + if (index > self.props.currentSlideIndex && index < (self.props.currentSlideIndex + self.props.visibleSlides)) { |
| 413 | + self.goTo(index); |
| 414 | + } |
420 | 415 | }, 0);
|
421 | 416 | });
|
422 | 417 | });
|
|
445 | 440 | if (!this.settings.layout.fixedHeight) {
|
446 | 441 | this._updateHeight();
|
447 | 442 | }
|
| 443 | + |
| 444 | + // Sync with other carousels |
| 445 | + if (this.settings.$syncedCarousels) { |
| 446 | + this.$dom.container.on(utils.getNamespacedEvents(syncEvent), $.proxy(function(event, params) { |
| 447 | + this.goTo(params.index, false, true); |
| 448 | + }, this)); |
| 449 | + } |
448 | 450 | },
|
449 | 451 |
|
450 | 452 | disable: function() {
|
|
986 | 988 |
|
987 | 989 | // Update slider based on currently visible slides
|
988 | 990 | // TODO: called twice on init
|
989 |
| - _updateHeight: function() { |
| 991 | + _updateHeight: function(targetHeight) { |
990 | 992 | var minIndex = this.props.currentDomIndex,
|
991 | 993 | maxIndex = minIndex + this.props.visible,
|
992 | 994 | filterSelector = (minIndex > 0) ? ':gt(' + (minIndex - 1) + '):lt(' + this.props.visible + ')' : ':lt(' + (maxIndex) + ')',
|
993 | 995 | maxHeight = this._getHighestSlide(),
|
994 | 996 | height = this._getHighestSlide(filterSelector);
|
995 | 997 |
|
| 998 | + if (targetHeight) { |
| 999 | + height = targetHeight; |
| 1000 | + maxHeight = '100em'; |
| 1001 | + } |
| 1002 | + |
996 | 1003 | this.$dom.slides.css('min-height', maxHeight);
|
997 | 1004 |
|
998 | 1005 | this.$dom.frame.animate({
|
|
0 commit comments