Fix bug where other panel tabs would switch the document panel tabs

This commit is contained in:
Keavon Chambers 2021-06-26 23:46:39 -07:00
parent b42991368a
commit 3ba570fa68
2 changed files with 8 additions and 0 deletions

View file

@ -17,6 +17,10 @@
background: var(--color-accent);
}
.icon-button {
background: unset;
}
svg {
width: 24px;
height: 24px;

View file

@ -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?");