Skip to content

Commit

Permalink
moved event.preventDefault() inside of if-then structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Kraus authored and heff committed Dec 19, 2014
1 parent ad3e430 commit 16d945c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/js/menu.js
Original file line number Diff line number Diff line change
@@ -182,7 +182,6 @@ vjs.MenuButton.prototype.onClick = function(){
};

vjs.MenuButton.prototype.onKeyPress = function(event){
event.preventDefault();

// Check for space bar (32) or enter (13) keys
if (event.which == 32 || event.which == 13) {
@@ -191,11 +190,13 @@ vjs.MenuButton.prototype.onKeyPress = function(event){
} else {
this.pressButton();
}
event.preventDefault();
// Check for escape (27) key
} else if (event.which == 27){
if (this.buttonPressed_){
this.unpressButton();
}
event.preventDefault();
}
};

0 comments on commit 16d945c

Please sign in to comment.