diff --git a/css/popupboxes.scss b/css/popupboxes.scss index afd79d1d6..febd5ef4b 100644 --- a/css/popupboxes.scss +++ b/css/popupboxes.scss @@ -112,6 +112,13 @@ background-color: #000; } +.log-box-button:hover, +.log-box-button:focus { + color: var(--my-font-color); + text-decoration: none; + cursor: pointer; +} + .dialog-box-content { z-index: 2; background-color: var(--my-background-color); diff --git a/utils/LogBox.tsx b/utils/LogBox.tsx index d1c8e8aff..7063193a2 100644 --- a/utils/LogBox.tsx +++ b/utils/LogBox.tsx @@ -48,6 +48,20 @@ function ScriptLogPopup(props: IProps): React.ReactElement { removeElementById(props.id); } + useEffect(() => { + function closeHandler(event: KeyboardEvent) { + if(event.keyCode === 27) { + close(); + } + } + + document.addEventListener('keydown', closeHandler); + + return () => { + document.removeEventListener('keydown', closeHandler); + } + }, []); + function kill(): void { killWorkerScript(props.script, props.script.server, true); close();