@setoelkahfi / svara / commits / 33594d0

attempting to fix tab closing via menu

mellobacon committed Aug 25, 2022 at 13:37 UTC 33594d0b076d118695a0163e1ba82ac95ad4ca12
1 file changed +3 -4
src/components/Content/Editor/TabMenu.svelte
+3 -4
@@ -17,19 +17,18 @@
17
18 <ContextMenu {target}>
19 <ContextMenuOption indented icon={CopyFile} labelText="Close Tab" on:click={() => {
20 - //closeTab(id);
21 - console.log(id);
20 + closeTab(id);
21 }}>
22 <span class="contextshortcut" slot="shortcutText">Ctrl + F4</span>
23 </ContextMenuOption>
24 <ContextMenuOption indented icon={Cut} labelText="Close Others" on:click={() => {
25 + // TODO: Fix this
26 let tabs = document.getElementsByClassName("tab");
27 - console.log(id);
27 for (const tab of tabs) {
28 let t = tab.id;
29 let tabid = parseInt(t.split("-").pop());
30 if (tabid !== id) {
32 - console.log(`close tab: ${tabid}`)
31 + closeTab(tabid);
32 }
33 }
34 }} ></ContextMenuOption>