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
area51mafia opened this Issue Sep 20, 2010 · 5 comments

Comments

Projects
None yet
2 participants
@area51mafia

area51mafia commented Sep 20, 2010

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

This comment has been minimized.

Show comment
Hide comment
@tipiirai

tipiirai Sep 20, 2010

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.

Contributor

tipiirai commented Sep 20, 2010

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.

@area51mafia

This comment has been minimized.

Show comment
Hide comment
@area51mafia

area51mafia Sep 21, 2010

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.

area51mafia commented Sep 21, 2010

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

This comment has been minimized.

Show comment
Hide comment
@tipiirai

tipiirai Sep 21, 2010

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.

Contributor

tipiirai commented Sep 21, 2010

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.

@area51mafia

This comment has been minimized.

Show comment
Hide comment
@area51mafia

area51mafia Sep 22, 2010

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

area51mafia commented Sep 22, 2010

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

@tipiirai

This comment has been minimized.

Show comment
Hide comment
@tipiirai

tipiirai Sep 23, 2010

Contributor

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

Contributor

tipiirai commented Sep 23, 2010

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