-
Notifications
You must be signed in to change notification settings - Fork 67
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
Loop function / Active Class #15
base: master
Are you sure you want to change the base?
Conversation
Apologies for not getting back to you sooner. I'll have a look this week. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm slightly less keen on the loop function. But then again, there might be something I'm not able to see in terms of use-case / enhancing the user's (i.e. anyone who downloads, and uses this library) experience. Thoughts welcomed.
@@ -22,6 +22,8 @@ | |||
animation: "bounceIn", | |||
separator: ",", | |||
speed: 2000, | |||
activeClass: 'active', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use double quotes here for consistency? I think with the new ESLint configuration, this should be caught.
@@ -22,6 +22,8 @@ | |||
animation: "bounceIn", | |||
separator: ",", | |||
speed: 2000, | |||
activeClass: 'active', | |||
loop: 10, // loop n times around TBC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if I'm keen on including an out-of-the-box support for a loop limit. Seems like something that can be achieved by the complete
callback.
|
||
|
||
|
||
//console.log(this.position); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly want to remove the comment here.
this.index = ++this.index % this.phrases.length; | ||
this.element[0].innerHTML = "<span class=\"animated " + this.settings.animation + "\">" + this.phrases[this.index] + "</span>"; | ||
this.element[0].classList.add(this.settings.activeClass); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if it's necessary for us to add
in every iteration. I feel like there should be a more elegant solution (e.g. setting a base class on the parent element, and having its style get overwritten by morphext
on line 41/45).
More ideas forth coming.