diff --git a/client/web/src/components/widgets/inputs/MenuBarInput.vue b/client/web/src/components/widgets/inputs/MenuBarInput.vue index 6fe09727..1def90c4 100644 --- a/client/web/src/components/widgets/inputs/MenuBarInput.vue +++ b/client/web/src/components/widgets/inputs/MenuBarInput.vue @@ -73,7 +73,7 @@ const menuEntries: MenuListEntries = [ ref: undefined, children: [ [ - { label: "New", icon: "File", shortcut: ["Ctrl", "N"] }, + { label: "New", icon: "File", shortcut: ["Ctrl", "N"], action: async () => (await wasm).new_document() }, { label: "Open…", shortcut: ["Ctrl", "O"] }, { label: "Open Recent", diff --git a/client/web/src/components/workspace/Panel.vue b/client/web/src/components/workspace/Panel.vue index acf42993..dc167abf 100644 --- a/client/web/src/components/workspace/Panel.vue +++ b/client/web/src/components/workspace/Panel.vue @@ -2,7 +2,7 @@
-
+
{{ tabLabel }}
@@ -144,6 +144,8 @@ import IconButton from "../widgets/buttons/IconButton.vue"; import PopoverButton, { PopoverButtonIcon } from "../widgets/buttons/PopoverButton.vue"; import { MenuDirection } from "../widgets/floating-menus/FloatingMenu.vue"; +const wasm = import("../../../wasm/pkg"); + export default defineComponent({ components: { Document, @@ -153,6 +155,12 @@ export default defineComponent({ IconButton, PopoverButton, }, + methods: { + async handleTabClick(tabIndex: number) { + const { select_document } = await wasm; + select_document(tabIndex); + }, + }, props: { tabMinWidths: { type: Boolean, default: false }, tabCloseButtons: { type: Boolean, default: false }, diff --git a/client/web/src/components/workspace/Workspace.vue b/client/web/src/components/workspace/Workspace.vue index 07c62a6b..2c966d55 100644 --- a/client/web/src/components/workspace/Workspace.vue +++ b/client/web/src/components/workspace/Workspace.vue @@ -1,13 +1,7 @@