Skip to content

Fix Hammerjs unbind events #85

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Growiel
Copy link

@Growiel Growiel commented May 19, 2016

Making the hammerjs instance a property of cropbox so we can properly
unbind the events in .remove();

While creating the pause function (see other PR), i noticed that in the remove() function, doing "hammerit = Hammer(this.$image.get(0));" was actually creating a NEW instance of hammerjs on the element instead of retrieving the existing one.

After looking around, just storing the one with used to bind the events seemd to be the easiest way to do it, so this PR does just that.

Making the hammerjs instance a property of cropbox so we can properly
unbind the events in .remove();
@acornejo
Copy link
Owner

this commit looks good, but the diff shows a dangling " var dragData;", why is that?

@@ -57,16 +57,17 @@
this.updateOptions();

if (typeof $.fn.hammer === 'function' || typeof Hammer !== 'undefined') {
var hammerit, dragData;
this.hammerit;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you do not need to declare hammirit since you ar enot using the variable yet (i.e. this is not a "var" declaration)

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.

2 participants