Precision for output and integral tooltips for display #17
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Firstly, I'm surprised this slider isn't more popular. I needed a cross-platform-capable slider for my project and looked all over. It seems my choices were: JQuery-UI (which I think is a bit heavy for a simple slider), an HTML polyfill (there are ZERO that actually work across all platforms that I could find, besides, not all projects use HTML5) or roll my own. This project is simple enough that it provided 90% of what I needed, thank you!
I see there are some pending touch-support commits, I would love to see these merged soon.
Anyway, these commits work together. First is just a removal of trailing whitespace (a pet-peeve of mine). Second is the addition of precision control for output values IF a step is defined. So, if your step is 0.01, the output will be fixed to 2 decimal places. It seems silly that this would be required, but thanks to the fuzziness of floating point numbers, it is. If no step is defined, the output is as it was: not fixed.
Finally, I've added support for an integral tooltip-style display of the output (which is one reason why the output precision was required).