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

Call unbind method within destroy method #378

Closed
happyhj opened this issue Sep 27, 2016 · 0 comments
Closed

Call unbind method within destroy method #378

happyhj opened this issue Sep 27, 2016 · 0 comments
Assignees
Milestone

Comments

@happyhj
Copy link
Contributor

happyhj commented Sep 27, 2016

Description

Should call unbind method within destroy method.
To remove keyValue for hammer.js instance.

Removing dependency of jQuery.fn.data also can be a solution.

Steps to check or reproduce

  1. Call movableCoord.prototype.bind method to the element.
  2. Call movableCoord.prototype.destory method
  3. Bind another movableCoord instance to the same element.
  4. Error occurs on line 124 bacause this._hammers[keyValue] is undefined but keyValue is still exists.

https://github.com/naver/egjs/blob/master/src/movableCoord.js#L124

            if (keyValue) {
                this._hammers[keyValue].inst.destroy();
            } else {
                keyValue = Math.round(Math.random() * new Date().getTime());
            }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants