From 9a96f6b231c2abde5999041557d4068342482255 Mon Sep 17 00:00:00 2001 From: Daniel Xie Date: Sat, 17 Jun 2017 13:19:37 -0500 Subject: [PATCH] Esc can be used to close log box. Log box close button scrolls down in fixed position --- css/popupboxes.css | 7 ++++++- utils/LogBox.js | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/css/popupboxes.css b/css/popupboxes.css index 0d0c019ba..8676f0da7 100644 --- a/css/popupboxes.css +++ b/css/popupboxes.css @@ -38,8 +38,8 @@ .dialog-box-close-button, #log-box-close { - color: #aaa; float: right; + color: #aaa; font-size: 20px; font-weight: bold; -webkit-border-radius: 12px; @@ -50,6 +50,11 @@ box-shadow: 1px 1px 3px #000; } +#log-box-close { + position: fixed; + right: 27%; +} + .dialog-box-close-button:hover, .dialog-box-close-button:focus, #log-box-close:hover, diff --git a/utils/LogBox.js b/utils/LogBox.js index 2c68b476b..c02156400 100644 --- a/utils/LogBox.js +++ b/utils/LogBox.js @@ -10,6 +10,12 @@ $(document).click(function(event) { } }); */ + +$(document).keydown(function(event) { + if (logBoxOpened && event.keyCode == 27) { + logBoxClose(); + } +}); function logBoxInit() { var closeButton = document.getElementById("log-box-close");