mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-28 17:48:12 +08:00
Fix bug where other panel tabs would switch the document panel tabs
This commit is contained in:
@@ -17,6 +17,10 @@
|
|||||||
background: var(--color-accent);
|
background: var(--color-accent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icon-button {
|
||||||
|
background: unset;
|
||||||
|
}
|
||||||
|
|
||||||
svg {
|
svg {
|
||||||
width: 24px;
|
width: 24px;
|
||||||
height: 24px;
|
height: 24px;
|
||||||
|
|||||||
@@ -158,10 +158,14 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async handleTabClick(tabIndex: number) {
|
async handleTabClick(tabIndex: number) {
|
||||||
|
if (this.panelType !== "Document") return;
|
||||||
|
|
||||||
const { select_document } = await wasm;
|
const { select_document } = await wasm;
|
||||||
select_document(tabIndex);
|
select_document(tabIndex);
|
||||||
},
|
},
|
||||||
async closeTab(tabIndex: number) {
|
async closeTab(tabIndex: number) {
|
||||||
|
if (this.panelType !== "Document") return;
|
||||||
|
|
||||||
const { close_document } = await wasm;
|
const { close_document } = await wasm;
|
||||||
// eslint-disable-next-line no-alert
|
// eslint-disable-next-line no-alert
|
||||||
const result = window.confirm("Closing this document will permanently discard all work. Continue?");
|
const result = window.confirm("Closing this document will permanently discard all work. Continue?");
|
||||||
|
|||||||
Reference in New Issue
Block a user