Skip to content

Commit

Permalink
Merge pull request #1 from danperkins/danperkins-patch-1
Browse files Browse the repository at this point in the history
Bug Fix for removing listeners
  • Loading branch information
danperkins committed May 4, 2015
2 parents fec73b2 + 2641b45 commit 14365b7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions interact.js
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@
for (i = 0; i < len; i++) {
remove(element, type, target.events[type][i], Boolean(useCapture));
}
return;
} else {
for (i = 0; i < len; i++) {
if (target.events[type][i] === listener) {
Expand Down Expand Up @@ -532,9 +533,9 @@
}

if (!target.typeCount) {
targets.splice(elementIndex);
elements.splice(elementIndex);
attachedListeners.splice(elementIndex);
targets.splice(elementIndex, 1);
elements.splice(elementIndex, 1);
attachedListeners.splice(elementIndex, 1);
}
}

Expand Down Expand Up @@ -5183,7 +5184,7 @@
= (object) @interact
\*/
unset: function () {
events.remove(this, 'all');
events.remove(this._element, 'all');

if (!isString(this.selector)) {
events.remove(this, 'all');
Expand Down

0 comments on commit 14365b7

Please sign in to comment.