Skip to content
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

feature(carousel): carousel-item interval #26667

Merged
merged 1 commit into from
Sep 18, 2018
Merged

feature(carousel): carousel-item interval #26667

merged 1 commit into from
Sep 18, 2018

Conversation

morrissey-ingenious
Copy link
Contributor

adds the ability to assign data-interval to an individual carousel-item.

I'm aware this may not be the proper way to add this functionality so please comment and give feedback and suggestions so that I can modify this pull request.

thanks

@@ -385,6 +385,20 @@ const Carousel = (($) => {
$(activeElement).addClass(directionalClassName)
$(nextElement).addClass(directionalClassName)

if ($(nextElement).data('interval')) {
Copy link
Member

Choose a reason for hiding this comment

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

Please use more vanilla JS and change that line by

const nextElementInterval = nextElement.getAttribute('data-interval')
if (nextElementInterval) {

{
interval : '(number|boolean)'
})
this._config.defautlInterval = this._config.defautlInterval || this._config.interval
Copy link
Member

Choose a reason for hiding this comment

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

typo here, it's not defautlInterval but defaultInterval

interval : '(number|boolean)'
})
this._config.defautlInterval = this._config.defautlInterval || this._config.interval
this._config.interval = $(nextElement).data('interval')
Copy link
Member

Choose a reason for hiding this comment

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

Here instead of get the value from the dom use nextElementInterval

@Johann-S
Copy link
Member

Johann-S commented Jun 6, 2018

There are a lots of things to do before we accept this MR :

  • please add a CodePen which demonstrate what your code is doing
  • add a unit test
  • update our documentation

@morrissey-ingenious
Copy link
Contributor Author

morrissey-ingenious commented Jun 6, 2018

Here is a CodePen displaying this functionality.

https://codepen.io/morrissey-ingenious/pen/qKabWv

@Johann-S
Copy link
Member

Johann-S commented Jun 7, 2018

very nice @morrissey-ingenious 👍

I want the feedbacks from other members before merging your PR

/CC @XhmikosR, @patrickhlauke, @mdo

adds the ability to assign data-interval to an individual carousel-item
@mdo mdo mentioned this pull request Sep 18, 2018
@XhmikosR XhmikosR merged commit ea0faad into twbs:v4-dev Sep 18, 2018
@morrissey-ingenious morrissey-ingenious deleted the 4-dev-carousel-item-interval branch September 18, 2018 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants