Improve stack header dropdown

This commit is contained in:
Mattias Granlund 2024-10-03 20:36:04 +02:00
parent 25fad4f376
commit 5c26def86b

View File

@ -32,21 +32,22 @@
<ContextMenu bind:this={contextMenuEl} {target}> <ContextMenu bind:this={contextMenuEl} {target}>
<ContextMenuSection> <ContextMenuSection>
<ContextMenuItem <ContextMenuItem
label="Add a description" disabled
label="Add description"
on:click={() => { on:click={() => {
addDescription(); addDescription();
contextMenuEl?.close(); contextMenuEl?.close();
}} }}
/> />
<ContextMenuItem <ContextMenuItem
label="Rename Series" label="Rename"
on:click={async () => { on:click={async () => {
renameSeriesModal.show(branch); renameSeriesModal.show(branch);
contextMenuEl?.close(); contextMenuEl?.close();
}} }}
/> />
<ContextMenuItem <ContextMenuItem
label="Delete Series Only" label="Delete"
on:click={() => { on:click={() => {
deleteSeriesModal.show(branch); deleteSeriesModal.show(branch);
contextMenuEl?.close(); contextMenuEl?.close();
@ -57,6 +58,7 @@
<Modal <Modal
width="small" width="small"
title="Rename series"
bind:this={renameSeriesModal} bind:this={renameSeriesModal}
onSubmit={(close) => { onSubmit={(close) => {
if (newHeadName && newHeadName !== headName) { if (newHeadName && newHeadName !== headName) {
@ -65,7 +67,7 @@
close(); close();
}} }}
> >
<TextBox label="Series Name" id="newSeriesName" bind:value={newHeadName} focus /> <TextBox placeholder="New name" id="newSeriesName" bind:value={newHeadName} focus />
{#snippet controls(close)} {#snippet controls(close)}
<Button style="ghost" outline type="reset" onclick={close}>Cancel</Button> <Button style="ghost" outline type="reset" onclick={close}>Cancel</Button>
@ -75,7 +77,7 @@
<Modal <Modal
width="small" width="small"
title="Delete Series Only" title="Delete series"
bind:this={deleteSeriesModal} bind:this={deleteSeriesModal}
onSubmit={async (close) => { onSubmit={async (close) => {
try { try {