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

Bugfix for calling unset method on an Interactable #178

Merged
merged 2 commits into from
May 5, 2015

Conversation

danperkins
Copy link
Contributor

I did some debugging today to find out that my event handlers are still holding references to my DOM elements after calling 'unset'. These changes seem to correct the issue. Please let me know what you think!

Three bug fixes for cleaning up listeners:
1. Call 'var myInteractable = interact(myElem)' --> the Interactable constructor will call 'events.add(this._element, ...)'
    The unset method -- 'myInteractable.unset()' -- should be calling 'events.remove(this._element, 'all')' to remove those event handlers
2.  The 'remove' method should only remove 1 element when calling splice instead of all elements after the specified index.
3.  On top of taye#2, the 'remove' method should return after looping through the 'all' listener condition so that the arrays are only spliced one time instead of twice (once after removing the specific handler and once after the 'all' loop finishes)
taye added a commit that referenced this pull request May 5, 2015
Bugfix for calling unset method on an Interactable
@taye taye merged commit d865a5e into taye:master May 5, 2015
@taye
Copy link
Owner

taye commented May 5, 2015

Very much appreciated!

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.

None yet

2 participants