功能:命令ToggleUI,隐藏UI

pull/1018/head
ChenX 4 years ago
parent b52b8019f9
commit 48c73f3a36

@ -0,0 +1,11 @@
export class Command_ToggleUI
{
async exec()
{
let els = ["#TopPanel", "#TopToolBar"].map(e => document.querySelector(e) as HTMLElement);
for (let el of els)
el.style.display = el.style.display === "none" ? "block" : "none";
}
}

@ -176,6 +176,7 @@ import { Command_ExportObj } from "../Add-on/Command_ExportObj";
import { UpdateBoardInfos } from "../Add-on/BoardEditor/UpdateBoardInfos"; import { UpdateBoardInfos } from "../Add-on/BoardEditor/UpdateBoardInfos";
import { Command_Conver2Polyline } from "../Add-on/Conver2Polyline"; import { Command_Conver2Polyline } from "../Add-on/Conver2Polyline";
import { Command_Curve2VSBox } from "../Add-on/twoD2threeD/Command_Curve2VSBox"; import { Command_Curve2VSBox } from "../Add-on/twoD2threeD/Command_Curve2VSBox";
import { Command_ToggleUI } from "../Add-on/ToggleUI";
export function registerCommand() export function registerCommand()
{ {
@ -486,6 +487,8 @@ export function registerCommand()
commandMachine.RegisterCommand("updateboardinfos", new UpdateBoardInfos()); commandMachine.RegisterCommand("updateboardinfos", new UpdateBoardInfos());
commandMachine.RegisterCommand("ToggleUI", new Command_ToggleUI());
RegistCustomCommand(); RegistCustomCommand();
} }

Loading…
Cancel
Save