Skip to content

Commit

Permalink
Changed keyup to keydown for more responive key listeners. closes #1545
Browse files Browse the repository at this point in the history
…, closes #1616
  • Loading branch information
rutkat authored and heff committed Nov 25, 2014
1 parent 7642691 commit 1211e6f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/js/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ vjs.MenuButton = vjs.Button.extend({
this.hide();
}

this.on('keyup', this.onKeyPress);
this.on('keydown', this.onKeyPress);
this.el_.setAttribute('aria-haspopup', true);
this.el_.setAttribute('role', 'button');
}
Expand Down
4 changes: 2 additions & 2 deletions src/js/slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ vjs.Slider.prototype.dispose = function() {
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, 'keydown', vjs.bind(this, this.onKeyPress));
vjs.off(document, 'keyup', vjs.bind(this, this.onKeyPress));

vjs.Component.prototype.dispose.call(this);
Expand Down Expand Up @@ -187,7 +187,7 @@ vjs.Slider.prototype.calculateDistance = function(event){
};

vjs.Slider.prototype.onFocus = function(){
vjs.on(document, 'keyup', vjs.bind(this, this.onKeyPress));
vjs.on(document, 'keydown', vjs.bind(this, this.onKeyPress));
};

vjs.Slider.prototype.onKeyPress = function(event){
Expand Down

0 comments on commit 1211e6f

Please sign in to comment.