Merge pull request #1504 from danielyxie/dev

@hydroflame logbox window z index fix
This commit is contained in:
hydroflame 2021-10-15 13:49:25 -04:00 committed by GitHub
commit 3d0c76b81b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 4 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -11,6 +11,7 @@ import { ResizableBox } from "react-resizable";
import makeStyles from "@mui/styles/makeStyles";
import createStyles from "@mui/styles/createStyles";
import ArrowForwardIosIcon from "@mui/icons-material/ArrowForwardIos";
import _ from "lodash";
export const LogBoxEvents = new EventEmitter<[RunningScript]>();
@ -86,9 +87,17 @@ function LogWindow(props: IProps): React.ReactElement {
killWorkerScript(props.script, props.script.server, true);
props.onClose();
}
//useEffect(() => TerminalEvents.subscribe(_.debounce(async () => rerender(), 25, { maxWait: 50 })), []);
function onDrag(): void {
const c = container.current;
if (c === null) return;
c.style.zIndex = (new Date().getTime() % 1000000) + "";
rerender();
}
return (
<Draggable handle="#drag">
<Draggable onDrag={onDrag} handle=".drag">
<Paper
style={{
display: "flex",
@ -105,7 +114,7 @@ function LogWindow(props: IProps): React.ReactElement {
cursor: "grab",
}}
>
<Box id="drag" display="flex" alignItems="center">
<Box className="drag" display="flex" alignItems="center">
<Typography color="primary" variant="h6">
{props.script.filename} {props.script.args.map((x: any): string => `${x}`).join(" ")}
</Typography>