Skip to content

Commit

Permalink
fix(transitionning): merge bootstrap fix for component is transitionn…
Browse files Browse the repository at this point in the history
…ing. See issue #50
  • Loading branch information
Lausselloic committed Apr 3, 2017
1 parent f60303c commit bb16f76
Show file tree
Hide file tree
Showing 15 changed files with 106 additions and 95 deletions.
23 changes: 14 additions & 9 deletions js/dist/carousel.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/dist/carousel.js.map

Large diffs are not rendered by default.

33 changes: 17 additions & 16 deletions js/dist/collapse.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/dist/collapse.js.map

Large diffs are not rendered by default.

11 changes: 7 additions & 4 deletions js/dist/scrollspy.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/dist/scrollspy.js.map

Large diffs are not rendered by default.

18 changes: 6 additions & 12 deletions js/dist/tooltip.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/dist/tooltip.js.map

Large diffs are not rendered by default.

11 changes: 7 additions & 4 deletions js/dist/util.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/dist/util.js.map

Large diffs are not rendered by default.

23 changes: 14 additions & 9 deletions js/src/carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,9 @@ const Carousel = (($) => {
// public

next() {
if (this._isSliding) {
throw new Error('Carousel is sliding')
if (!this._isSliding) {
this._slide(Direction.NEXT)
}
this._slide(Direction.NEXT)
}

nextWhenVisible() {
Expand All @@ -134,10 +133,9 @@ const Carousel = (($) => {
}

prev() {
if (this._isSliding) {
throw new Error('Carousel is sliding')
if (!this._isSliding) {
this._slide(Direction.PREV)
}
this._slide(Direction.PREV)
}

pause(event) {
Expand Down Expand Up @@ -282,9 +280,13 @@ const Carousel = (($) => {


_triggerSlideEvent(relatedTarget, eventDirectionName) {
const targetIndex = this._getItemIndex(relatedTarget)
const fromIndex = this._getItemIndex($(this._element).find(Selector.ACTIVE_ITEM)[0])
const slideEvent = $.Event(Event.SLIDE, {
relatedTarget,
direction: eventDirectionName
direction: eventDirectionName,
from: fromIndex,
to: targetIndex
})

$(this._element).trigger(slideEvent)
Expand All @@ -310,9 +312,10 @@ const Carousel = (($) => {

_slide(direction, element) {
const activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0]
const activeElementIndex = this._getItemIndex(activeElement)
const nextElement = element || activeElement &&
this._getItemByDirection(direction, activeElement)

const nextElementIndex = this._getItemIndex(nextElement)
const isCycling = Boolean(this._interval)

let directionalClassName
Expand Down Expand Up @@ -354,7 +357,9 @@ const Carousel = (($) => {

const slidEvent = $.Event(Event.SLID, {
relatedTarget: nextElement,
direction: eventDirectionName
direction: eventDirectionName,
from: activeElementIndex,
to: nextElementIndex
})

if (Util.supportsTransitionEnd() &&
Expand Down
Loading

0 comments on commit bb16f76

Please sign in to comment.