Skip to content

Commit

Permalink
oncase#1 - Added ESC keypress listener to dismiss box overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitor Torreao committed May 29, 2015
1 parent 19bee73 commit 771afb0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion js/PageController.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ function PageController(){
_body.append(overlay);
$(".pg-overlay-close").unbind()
.click(_enableMainPage);
_body.keyup(
function(event) {
if (event.keyCode == 27) {
page.enableMainPage();
}
}
);

if ($("#main_content").find("img").length > 0) {
$("#main_content img").on('load', function() {
Expand Down Expand Up @@ -92,4 +99,4 @@ function PageController(){
disableMainPage : _disableMainPage
};

}
}

0 comments on commit 771afb0

Please sign in to comment.