mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-22 15:43:49 +01:00
logbox close on escape now
This commit is contained in:
parent
0b3c114cd0
commit
b148b2f0b5
@ -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);
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user