mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-01 20:45:57 +03:00
Merge pull request #1247 from gitbutlerapp/fix-popup-menu-collapse
chore: update context menu in code editor component
This commit is contained in:
commit
568c59cd4d
@ -222,11 +222,17 @@
|
||||
{/each}
|
||||
{#if !subsection.expanded}
|
||||
<div
|
||||
role="group"
|
||||
class="border-color-3 flex w-full"
|
||||
class:border-t={sidx == section.subSections.length - 1 ||
|
||||
(sidx > 0 && sidx < section.subSections.length - 1)}
|
||||
class:border-b={sidx == 0 ||
|
||||
(sidx > 0 && sidx < section.subSections.length - 1)}
|
||||
on:contextmenu|preventDefault={(e) =>
|
||||
popupMenu.openByMouse(e, {
|
||||
section: section,
|
||||
hunk
|
||||
})}
|
||||
>
|
||||
<div
|
||||
class="bg-color-4 text-color-4 hover:text-color-2 border-color-3 border-r text-center"
|
||||
|
@ -16,21 +16,23 @@
|
||||
</script>
|
||||
|
||||
<PopupMenu bind:this={popupMenu} let:item>
|
||||
<PopupMenuItem
|
||||
on:click={() => {
|
||||
if ('expanded' in item.section) {
|
||||
{#if 'expanded' in item.section}
|
||||
<PopupMenuItem
|
||||
on:click={() => {
|
||||
item.section.expanded = false;
|
||||
}
|
||||
}}
|
||||
>
|
||||
Collapse
|
||||
</PopupMenuItem>
|
||||
}}
|
||||
>
|
||||
Collapse
|
||||
</PopupMenuItem>
|
||||
{/if}
|
||||
{#if item.hunk !== undefined && !item.hunk.locked}
|
||||
<PopupMenuItem on:click={() => branchController.unapplyHunk(item.hunk)}>Discard</PopupMenuItem>
|
||||
{/if}
|
||||
<PopupMenuItem
|
||||
on:click={() => open(`vscode://file${projectPath}/${file.path}:${item.lineNumber}`)}
|
||||
>
|
||||
Open in Visual Studio Code
|
||||
</PopupMenuItem>
|
||||
{#if item.lineNumber}
|
||||
<PopupMenuItem
|
||||
on:click={() => open(`vscode://file${projectPath}/${file.path}:${item.lineNumber}`)}
|
||||
>
|
||||
Open in Visual Studio Code
|
||||
</PopupMenuItem>
|
||||
{/if}
|
||||
</PopupMenu>
|
||||
|
Loading…
Reference in New Issue
Block a user