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

Incorrect "this" in the "attachWheel" function #138

Open
ne0x opened this issue May 30, 2014 · 2 comments
Open

Incorrect "this" in the "attachWheel" function #138

ne0x opened this issue May 30, 2014 · 2 comments

Comments

@ne0x
Copy link

ne0x commented May 30, 2014

We have this === window inside attachWheel function, because attachWheel(); is called in the code without context. I think it is not necessary to use window and it will be more semantic to use the target element. Also it will save resources in case when the scrolled container is removed without destroy, so the garbage collector will have possibility to clean dead event handlers. We can just replace attachWheel() with attachWheel.call(this) to fix it.

ne0x pushed a commit to ne0x/jQuery-slimScroll that referenced this issue May 30, 2014
@alvarotrigo
Copy link

This still not solving the problem. The detachWheel method doesn't actually remove the mouse handler...

You can try it in this demo as I explained in this other opened issue

@alvarotrigo
Copy link

A problem related with the releaseScroll var probably?

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