From 0692bc87277d48b4ec9e9e1cc3f17158dff9f85a Mon Sep 17 00:00:00 2001 From: Keavon Chambers Date: Sat, 26 Jun 2021 23:46:39 -0700 Subject: [PATCH] Fix bug where other panel tabs would switch the document panel tabs --- client/web/src/components/widgets/ShelfItem.vue | 4 ++++ client/web/src/components/workspace/Panel.vue | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/client/web/src/components/widgets/ShelfItem.vue b/client/web/src/components/widgets/ShelfItem.vue index 670adb27..29595633 100644 --- a/client/web/src/components/widgets/ShelfItem.vue +++ b/client/web/src/components/widgets/ShelfItem.vue @@ -17,6 +17,10 @@ background: var(--color-accent); } + .icon-button { + background: unset; + } + svg { width: 24px; height: 24px; diff --git a/client/web/src/components/workspace/Panel.vue b/client/web/src/components/workspace/Panel.vue index 5b59705a..237b46bb 100644 --- a/client/web/src/components/workspace/Panel.vue +++ b/client/web/src/components/workspace/Panel.vue @@ -158,10 +158,14 @@ export default defineComponent({ }, methods: { async handleTabClick(tabIndex: number) { + if (this.panelType !== "Document") return; + const { select_document } = await wasm; select_document(tabIndex); }, async closeTab(tabIndex: number) { + if (this.panelType !== "Document") return; + const { close_document } = await wasm; // eslint-disable-next-line no-alert const result = window.confirm("Closing this document will permanently discard all work. Continue?");