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

additional class support on 'rangeHighlights' option #742

Merged
merged 7 commits into from
Apr 25, 2017

Conversation

jccode
Copy link

@jccode jccode commented Apr 20, 2017

Hi seiyria, would you please accept the pull request? Thank you.

screenshot

@seiyria
Copy link
Owner

seiyria commented Apr 20, 2017

It looks like we need a unit test to make sure this works correctly. After that, I think it looks good.

@jccode
Copy link
Author

jccode commented Apr 22, 2017

Yup, unit test are updated as well.
I'm sorry that I uploaded the dist directory, which cause some "duplicate code" check error. Does it matter?

@seiyria
Copy link
Owner

seiyria commented Apr 22, 2017

we'd prefer if it wasn't there, yes.

@rovolution
Copy link
Collaborator

@jccode the dist directory is compiled code, which is generated from the code in the src directory. Please make your changes to the src directory code thanks!

@jccode
Copy link
Author

jccode commented Apr 23, 2017

@rovolution I know. My code changes are already apply to src directory.
Which makes me confused is the duplication is between src/bootstrap-slider.js and dist/bootstrap-slider.js. Would you please help to take a look at the detail check results, and give some advice to fix this check issue?

@seiyria
Copy link
Owner

seiyria commented Apr 23, 2017

Just don't commit dist. the difference is that dist is the built files, and src is the source code.

@jccode
Copy link
Author

jccode commented Apr 23, 2017

@seiyria I rollback the dist files. Now all checks have passed. Thank you. :)

Copy link
Collaborator

@rovolution rovolution left a comment

Choose a reason for hiding this comment

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

@jccode looks solid! I left some brief feedback but once thats incorporated ping me for a final review

if (Array.isArray(this.options.rangeHighlights) && this.options.rangeHighlights.length > 0) {
for (let j = 0; j < this.options.rangeHighlights.length; j++) {

var rangeHighlightsOpts = this.options.rangeHighlights;
Copy link
Collaborator

Choose a reason for hiding this comment

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

could you fix the spacing and declare this as a const instead of a var since the value is not being reassigned? thanks!

@jccode
Copy link
Author

jccode commented Apr 23, 2017

Sorry that I wan't aware of the spacing issue. Thanks for your review.

Copy link
Collaborator

@rovolution rovolution left a comment

Choose a reason for hiding this comment

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

@jccode sorry! one more piece of feedback and it should be good.

I pulled it down and tested it locally and it works great btw...awesome work!

var rangeHighlightElement = document.createElement("div");
rangeHighlightElement.className = "slider-rangeHighlight slider-selection";

rangeHighlightElement.className = "slider-rangeHighlight slider-selection " + (rangeHighlightsOpts[j].class || "");
Copy link
Collaborator

Choose a reason for hiding this comment

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

could you refactor this to use an ES6 template string instead? I think it will help make the code a bit cleaner:

const customClassString = rangeHighlightsOpts[j].class || "";
rangeHighlightElement.className = `slider-rangeHighlight slider-selection ${customClassString}`;

Copy link
Author

Choose a reason for hiding this comment

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

WOW! Thanks for the great suggestion.

@rovolution rovolution merged commit b514e6c into seiyria:master Apr 25, 2017
@rovolution
Copy link
Collaborator

@jccode merged and published to 9.8.0. Thanks again for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants