From d79a956b0c849a3fa02cb08d3e585300b92c805e Mon Sep 17 00:00:00 2001 From: Greg Kraus Date: Fri, 19 Dec 2014 15:40:57 -0500 Subject: [PATCH] moved event.preventDefault() inside of if-then structure --- src/js/menu.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/js/menu.js b/src/js/menu.js index 189598a8e6..d4a2ae3f7b 100644 --- a/src/js/menu.js +++ b/src/js/menu.js @@ -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(); } };