handleDispose: function handleDispose(event) {
this.off('mousemove', this.handleMouseMove.bind(this));
this.off('touchmove', this.handleTouchMove.bind(this));
...
}
Witch is useless becasue .bind() creates a new function on each call so the .off() method can't find the original functions what added via the .on() method.
A solution for this problem may be something like this:
The code of
handleDispose()
is someting like:Witch is useless becasue
.bind()
creates a new function on each call so the.off()
method can't find the original functions what added via the.on()
method.A solution for this problem may be something like this:
In addition,
handleDispose
do not remove this event that was binded on theconstructor
: