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

Slide drag doesn't recalculate dimensions #177

Closed
zachswasey opened this issue Sep 20, 2010 · 5 comments
Closed

Slide drag doesn't recalculate dimensions #177

zachswasey opened this issue Sep 20, 2010 · 5 comments

Comments

@zachswasey
Copy link

I've been working on a scrolling div with a handle proportional to the width of the content on the inside and came across a drag bug. Rangeinput doesn't call init() in the dragStart binding of the handle, so if the handle's been resized since the last time init() was called then it'll allow for dragging out of the slider area. I noticed that init() is called upon clicking somewhere in the slider, prior to moving the handle, and when I implemented that in dragStart it worked wonderfully. I'm not sure what this may break, but it seems that init() should be in dragStart.

@tipiirai
Copy link
Contributor

this is now changed. here is the commit:

http://github.com/jquerytools/jquerytools/commit/b3e9d79aecd6cba1e78a3ecd498d71d097a9561b

and here is the updated file

http://github.com/jquerytools/jquerytools/raw/b3e9d79aecd6cba1e78a3ecd498d71d097a9561b/src/rangeinput/rangeinput.js

please try and tell if it helps. I went trough the demos with that version and it worked as expected.

@zachswasey
Copy link
Author

I submitted this issue without realizing that I could just make the patch myself and submit it for review, but all that needed to be done was add init() to the dragStart, not remove it from the root.click, so putting that back will work as expected. Also, before every setValue should probably call init() as well, as it calls slide, which would need updated values of dimensions incase anything has changed.

@tipiirai
Copy link
Contributor

ok. now there is an init call on click, setValue and onDragStart. here is the latest version:

http://github.com/jquerytools/jquerytools/raw/b780ebba630350f3f19e1dcec0bdc1969b806b28/src/rangeinput/rangeinput.js

beginning to dislike the source code and it's organization. will make a rewrite for 1.3.

@zachswasey
Copy link
Author

This seems to work in all cases that I have tried.

@tipiirai
Copy link
Contributor

very nice indeed. 1.2.5 is out now with the changes.

This issue was closed.
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

No branches or pull requests

2 participants