1
0
mirror of https://github.com/videojs/video.js.git synced 2025-01-25 11:13:52 +02:00

@mynameisstephen fixed an issue where slider event listeners were not cleaned up. closes #1475

This commit is contained in:
Stephen 2014-09-29 15:54:52 -07:00 committed by Steve Heffernan
parent fd181aa9cd
commit d93bea98d7
2 changed files with 12 additions and 0 deletions

View File

@ -4,6 +4,7 @@ CHANGELOG
## HEAD (Unreleased)
* @deedos added a Brazilian Portuguese translation ([view](https://github.com/videojs/video.js/pull/1520))
* @baloneysandwiches added a hasClass method ([view](https://github.com/videojs/video.js/pull/1464))
* @mynameisstephen fixed an issue where slider event listeners were not being cleaned up ([view](https://github.com/videojs/video.js/pull/1475))
--------------------

View File

@ -34,6 +34,17 @@ vjs.Slider = vjs.Component.extend({
}
});
vjs.Slider.prototype.dispose = function() {
vjs.off(document, 'mousemove', this.boundEvents.move, false);
vjs.off(document, 'mouseup', this.boundEvents.end, false);
vjs.off(document, 'touchmove', this.boundEvents.move, false);
vjs.off(document, 'touchend', this.boundEvents.end, false);
vjs.off(document, 'keyup', vjs.bind(this, this.onKeyPress));
vjs.Component.prototype.dispose.call(this);
};
vjs.Slider.prototype.createEl = function(type, props) {
props = props || {};
// Add the slider element class to all sub classes