Skip to content

labels stay contained within element containing slider #135

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

Closed
wants to merge 3 commits into from

Conversation

karelcallens
Copy link

Adaptation to the setLeft for the Low and HighHandle label and the combined label.

@karelcallens
Copy link
Author

I hope I did right this time. My first PR, so had to find out how to get it working correctly.

@ValentinH
Copy link
Member

It seems good to me but there is just a little more to be done:

  • when using a slider with a single value, it works well on the left (for the min value) but not for the right (max one). Here's an example: http://jsfiddle.net/xuf9j0ta/

With a range slider, everything seems to be fine: http://jsfiddle.net/ufez818p/

@ValentinH
Copy link
Member

I think you need to add this to the update lowHandle:

var left = Math.min(Math.max(newOffset - this.minLab.rzsw / 2 + this.handleHalfWidth, 0), this.barWidth - this.ceilLab.rzsw);
this.setLeft(this.minLab, left);

@ValentinH
Copy link
Member

This PR is ready to be merged I think, you just need to rebase it on top of master so there is no conflict ;)

@ValentinH
Copy link
Member

Since I got no news, I added your code to master manually. Thanks ;)

@ValentinH ValentinH closed this Nov 23, 2015
@zebslc
Copy link

zebslc commented Nov 23, 2015

Brilliant. You are awesome. 👍

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.

3 participants