mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-30 03:23:48 +01:00
Adapted PR #2055 to the refacted script editor code
This commit is contained in:
parent
e5c4c8f64b
commit
6d90025370
@ -144,6 +144,13 @@ export function Root(props: IProps): React.ReactElement {
|
|||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
save();
|
save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CTRL/CMD + S
|
||||||
|
if (event.code == `KeyS` && (event.ctrlKey || event.metaKey)) {
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
save();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
document.addEventListener("keydown", maybeSave);
|
document.addEventListener("keydown", maybeSave);
|
||||||
return () => document.removeEventListener("keydown", maybeSave);
|
return () => document.removeEventListener("keydown", maybeSave);
|
||||||
@ -623,7 +630,7 @@ export function Root(props: IProps): React.ReactElement {
|
|||||||
<Typography color={updatingRam ? "secondary" : "primary"} sx={{ mx: 1 }}>
|
<Typography color={updatingRam ? "secondary" : "primary"} sx={{ mx: 1 }}>
|
||||||
{ram}
|
{ram}
|
||||||
</Typography>
|
</Typography>
|
||||||
<Button onClick={save}>Save & Close (Ctrl/Cmd + b)</Button>
|
<Button onClick={save}>Save & Close (Ctrl/Cmd + s)</Button>
|
||||||
<Typography sx={{ mx: 1 }}>
|
<Typography sx={{ mx: 1 }}>
|
||||||
{" "}
|
{" "}
|
||||||
Documentation:{" "}
|
Documentation:{" "}
|
||||||
|
Loading…
Reference in New Issue
Block a user