Fix branch lane context menu

- made it unclickable by mistake
This commit is contained in:
Mattias Granlund 2023-12-13 16:08:43 +01:00
parent dc6f23ccd3
commit 82b861758c
2 changed files with 21 additions and 4 deletions

View File

@ -21,6 +21,7 @@
class="menu-item"
class:disabled
{id}
on:click
on:click={(e) => {
e.stopPropagation();
if (id && !disabled) selection$.next({ id, label });

View File

@ -31,11 +31,20 @@
on:click={() => branch.id && branchController.unapplyBranch(branch.id)}
/>
<ContextMenuItem label="Delete" on:click={() => deleteBranchModal.show(branch)} />
<ContextMenuItem
label="Delete"
on:click={() => {
deleteBranchModal.show(branch);
visible = false;
}}
/>
<ContextMenuItem
label="Generate branch name"
on:click={() => dispatch('action', 'generate-branch-name')}
on:click={() => {
dispatch('action', 'generate-branch-name');
visible = false;
}}
disabled={!$aiGenEnabled}
/>
</ContextMenuSection>
@ -43,12 +52,18 @@
<ContextMenuSection>
<ContextMenuItem
label="Create branch before"
on:click={() => branchController.createBranch({ order: branch.order })}
on:click={() => {
branchController.createBranch({ order: branch.order });
visible = false;
}}
/>
<ContextMenuItem
label="Create branch after"
on:click={() => branchController.createBranch({ order: branch.order + 1 })}
on:click={() => {
branchController.createBranch({ order: branch.order + 1 });
visible = false;
}}
/>
</ContextMenuSection>
</ContextMenu>
@ -63,6 +78,7 @@
color="error"
on:click={async () => {
await branchController.deleteBranch(branch.id);
visible = false;
}}
>
Delete