Skip to content

Fixed carousel issues #17 #38

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 11, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions components/carousel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@
},
// start auto rotate slides
start() {
if (this.interval === 0 || typeof this.interval === 'undefined') return;
this._intervalId = setInterval(function () {
this.next()
}, this.interval);
if (this.interval === 0 || typeof this.interval === 'undefined') return;
this._intervalId = setInterval( () => {
this.next()
}, this.interval);
}
},
mounted() {
Expand Down Expand Up @@ -158,12 +158,12 @@
this._items[oldVal].classList.add(this.direction.outgoing);
this._items[val].classList.remove(this.direction.incoming);
// wait for animation to finish and cleanup classes
this._carouselAnimation = setTimeout(function () {
this._items[oldVal].classList.remove(this.direction.outgoing, 'active');
this._items[val].classList.remove(this.direction.overlay);
this.animating = false;
// trigger an event
$root.$emit('slid::carousel', val)
this._carouselAnimation = setTimeout( () => {
this._items[oldVal].classList.remove(this.direction.outgoing, 'active');
this._items[val].classList.remove(this.direction.overlay);
this.animating = false;
// trigger an event
this.$root.$emit('slid::carousel', val)
}, TRANSITION_DURATION);
}
},
Expand Down
4 changes: 2 additions & 2 deletions components/components.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import bButtonRadio from './button-radio'
import bButton from './button'
import bCard from './card'
import bCarousel from './carousel'
import bCarouselSlide from './carousel'
import bCarouselSlide from './carousel-slide'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'import' is only available in ES6 (use 'esversion: 6').
Missing semicolon.

import bCollapse from './collapse'
import bCollapseToggle from './collapse-toggle'
import bDropdown from './dropdown'
Expand Down Expand Up @@ -67,7 +67,7 @@ export {
bNavItemDropdown,
bListGroupItem,
bListGroup,
bCarouselSlide,
bCarouselSlide as bSlide,
bCarousel,
bCollapse,
bCollapseToggle
Expand Down