Skip to content

Commit

Permalink
Fixing #245
Browse files Browse the repository at this point in the history
  • Loading branch information
thednp committed Oct 8, 2018
1 parent feca9c5 commit 9cf7bf0
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 13 deletions.
16 changes: 11 additions & 5 deletions dist/bootstrap-native-v4.js
Original file line number Diff line number Diff line change
Expand Up @@ -518,13 +518,13 @@
var pauseHandler = function () {
if ( self[interval] !==false && !hasClass(element,paused) ) {
addClass(element,paused);
!isSliding && clearInterval( timer );
!isSliding && ( clearInterval(timer), timer = null );
}
},
resumeHandler = function() {
if ( self[interval] !== false && hasClass(element,paused) ) {
removeClass(element,paused);
!isSliding && clearInterval( timer );
!isSliding && ( clearInterval(timer), timer = null );
!isSliding && self.cycle();
}
},
Expand Down Expand Up @@ -583,6 +583,11 @@

// public methods
this.cycle = function() {
if (timer) {
clearInterval(timer);
timer = null;
}

timer = setInterval(function() {
isElementInScrollRange() && (index++, self.slideTo( index ) );
}, this[interval]);
Expand All @@ -605,7 +610,7 @@

// find the right next index
if ( next < 0 ) { next = total - 1; }
else if ( next === total ){ next = 0; }
else if ( next >= total ){ next = 0; }

// update index
index = next;
Expand All @@ -615,6 +620,7 @@

isSliding = true;
clearInterval(timer);
timer = null;
setActivePage( next );

if ( supportTransitions && hasClass(element,'slide') ) {
Expand Down Expand Up @@ -894,7 +900,7 @@
bootstrapCustomEvent.call(parent, showEvent, component, relatedTarget);
addClass(menu,showClass);
addClass(parent,showClass);
menu[setAttribute](ariaExpanded,true);
element[setAttribute](ariaExpanded,true);
bootstrapCustomEvent.call(parent, shownEvent, component, relatedTarget);
element[open] = true;
off(element, clickEvent, clickHandler);
Expand All @@ -907,7 +913,7 @@
bootstrapCustomEvent.call(parent, hideEvent, component, relatedTarget);
removeClass(menu,showClass);
removeClass(parent,showClass);
menu[setAttribute](ariaExpanded,false);
element[setAttribute](ariaExpanded,false);
bootstrapCustomEvent.call(parent, hiddenEvent, component, relatedTarget);
element[open] = false;
toggleDismiss();
Expand Down
Loading

0 comments on commit 9cf7bf0

Please sign in to comment.