bugfix: content not show

This commit is contained in:
KuthorX committed 2021-07-10 14:27:58 +08:00
1 parent 393c36109f
commit ed454e25be
2 files changed
+8 -3

No files matched your search

+1
View File
@@ -34,6 +34,7 @@ body {
opacity : 0; opacity : 0;
transition : opacity 0.3s; transition : opacity 0.3s;
cursor : col-resize; cursor : col-resize;
z-index : 10;
} }
.content { .content {
+7 -3
View File
@@ -86,7 +86,8 @@ export default class Main extends Component {
const sider: any = document.getElementsByClassName("sider")[0]; const sider: any = document.getElementsByClassName("sider")[0];
const reSizerParent: any = document.getElementsByClassName("ant-layout-sider-children")[0]; const reSizerParent: any = document.getElementsByClassName("ant-layout-sider-children")[0];
const reSizer = document.getElementById("sizer-hint-bar"); const reSizer: any = document.getElementById("sizer-hint-bar");
const content: any = document.getElementsByClassName("ant-layout-content content")[0];
function initDrag(e: DragEvent) { function initDrag(e: DragEvent) {
startX = e.clientX; startX = e.clientX;
@@ -114,6 +115,7 @@ export default class Main extends Component {
sider.style.minWidth = "0px"; sider.style.minWidth = "0px";
sider.style.flex = ""; sider.style.flex = "";
reSizer.style.left = (width - 5) + "px"; reSizer.style.left = (width - 5) + "px";
content.style.width = window.innerWidth - width + "px";
} }
function stopDrag(e: DragEvent) { function stopDrag(e: DragEvent) {
@@ -132,7 +134,9 @@ export default class Main extends Component {
window.addEventListener("resize", function() { window.addEventListener("resize", function() {
const currentWidth = parseInt(document.defaultView.getComputedStyle(reSizerParent).width, 10); const currentWidth = parseInt(document.defaultView.getComputedStyle(reSizerParent).width, 10);
setWidth(currentWidth); setWidth(currentWidth);
}) });
setWidth(250);
} }
updateSettings() { updateSettings() {
@@ -144,7 +148,7 @@ export default class Main extends Component {
const { workdir, workspace } = this.state; const { workdir, workspace } = this.state;
document.title = `行为树编辑器 - ${workspace}`; document.title = `行为树编辑器 - ${workspace}`;
return ( return (
<Layout className="body"> <Layout className="body" style={{flexDirection: "column"}}>
<Sider className="sider" width={250}> <Sider className="sider" width={250}>
{workdir !== "" ? ( {workdir !== "" ? (
<Explorer <Explorer