Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
thednp committed Feb 1, 2021
1 parent 964f9ac commit e3719ee
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 20 deletions.
10 changes: 4 additions & 6 deletions dist/bootstrap-native-v5-esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ function Carousel( carouselElement, carouselOptions ){
orientation = direction === 'left' ? 'next' : 'prev',
directionClass = direction === 'left' ? 'start' : 'end';

if ( element[carouselComponent] ){
if ( isAnimating && element[carouselComponent] ){
isAnimating = false;

addClass( slides[next], activeClass );
Expand Down Expand Up @@ -562,8 +562,6 @@ function Carousel( carouselElement, carouselOptions ){

var eventTarget = e.currentTarget || e.srcElement;

if ( isAnimating ) { return }

if ( controls[1] && eventTarget === controls[1] ) {
self.next();
} else if ( controls[1] && eventTarget === controls[0] ) {
Expand All @@ -575,7 +573,7 @@ function Carousel( carouselElement, carouselOptions ){
var which = ref.which;


if ( isAnimating || !isElementInScrollRange( element ) ) { return }
if ( !isElementInScrollRange( element ) ) { return }

switch ( which ) {
case 39:
Expand Down Expand Up @@ -747,11 +745,11 @@ function Carousel( carouselElement, carouselOptions ){
};

CarouselProto.next = function() {
index++, self.to( index );
!isAnimating && index++, self.to( index );
};

CarouselProto.prev = function() {
index--, self.to( index );
!isAnimating && index--, self.to( index );
};

CarouselProto.to = function( next ) {
Expand Down
2 changes: 1 addition & 1 deletion dist/bootstrap-native-v5-esm.min.js

Large diffs are not rendered by default.

10 changes: 4 additions & 6 deletions dist/bootstrap-native-v5.js
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@
orientation = direction === 'left' ? 'next' : 'prev',
directionClass = direction === 'left' ? 'start' : 'end';

if ( element[carouselComponent] ){
if ( isAnimating && element[carouselComponent] ){
isAnimating = false;

addClass( slides[next], activeClass );
Expand Down Expand Up @@ -568,8 +568,6 @@

var eventTarget = e.currentTarget || e.srcElement;

if ( isAnimating ) { return }

if ( controls[1] && eventTarget === controls[1] ) {
self.next();
} else if ( controls[1] && eventTarget === controls[0] ) {
Expand All @@ -581,7 +579,7 @@
var which = ref.which;


if ( isAnimating || !isElementInScrollRange( element ) ) { return }
if ( !isElementInScrollRange( element ) ) { return }

switch ( which ) {
case 39:
Expand Down Expand Up @@ -753,11 +751,11 @@
};

CarouselProto.next = function() {
index++, self.to( index );
!isAnimating && index++, self.to( index );
};

CarouselProto.prev = function() {
index--, self.to( index );
!isAnimating && index--, self.to( index );
};

CarouselProto.to = function( next ) {
Expand Down
2 changes: 1 addition & 1 deletion dist/bootstrap-native-v5.min.js

Large diffs are not rendered by default.

10 changes: 4 additions & 6 deletions src/components-v5/carousel-native.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export default function Carousel( carouselElement, carouselOptions ){
orientation = direction === 'left' ? 'next' : 'prev',
directionClass = direction === 'left' ? 'start' : 'end'

if ( element[carouselComponent] ){
if ( isAnimating && element[carouselComponent] ){
isAnimating = false

addClass( slides[next], activeClass )
Expand Down Expand Up @@ -135,8 +135,6 @@ export default function Carousel( carouselElement, carouselOptions ){

const eventTarget = e.currentTarget || e.srcElement

if ( isAnimating ) return

if ( controls[1] && eventTarget === controls[1] ) {
self.next()
} else if ( controls[1] && eventTarget === controls[0] ) {
Expand All @@ -146,7 +144,7 @@ export default function Carousel( carouselElement, carouselOptions ){

function carouselKeyHandler({ which }) {

if ( isAnimating || !isElementInScrollRange( element ) ) return
if ( !isElementInScrollRange( element ) ) return

switch ( which ) {
case 39:
Expand Down Expand Up @@ -320,11 +318,11 @@ export default function Carousel( carouselElement, carouselOptions ){
}

CarouselProto.next = function() {
index++, self.to( index )
!isAnimating && index++, self.to( index )
}

CarouselProto.prev = function() {
index--, self.to( index )
!isAnimating && index--, self.to( index )
}

CarouselProto.to = function( next ) {
Expand Down

0 comments on commit e3719ee

Please sign in to comment.