mirror of
https://github.com/immich-app/immich.git
synced 2026-03-08 02:57:48 +03:00
chore(web): context menu improvements (#10475)
- ability to add custom hover colors - migrate activity menu to ButtonContextMenu component - onClick callbacks rather than events for menu options - remove slots - configurable menu option colors - improve menu option layout
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
</script>
|
||||
|
||||
<MenuOption
|
||||
on:click={() => (showAlbumPicker = true)}
|
||||
onClick={() => (showAlbumPicker = true)}
|
||||
text={shared ? $t('add_to_shared_album') : $t('add_to_album')}
|
||||
icon={shared ? mdiShareVariantOutline : mdiImageAlbum}
|
||||
/>
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
</script>
|
||||
|
||||
{#if menuItem}
|
||||
<MenuOption {text} {icon} on:click={handleArchive} />
|
||||
<MenuOption {text} {icon} onClick={handleArchive} />
|
||||
{/if}
|
||||
|
||||
{#if !menuItem}
|
||||
|
||||
@@ -34,6 +34,6 @@
|
||||
|
||||
{#each jobs as job}
|
||||
{#if isAllVideos || job !== AssetJobName.TranscodeVideo}
|
||||
<MenuOption text={getAssetJobName(job)} icon={getAssetJobIcon(job)} on:click={() => handleRunJob(job)} />
|
||||
<MenuOption text={getAssetJobName(job)} icon={getAssetJobIcon(job)} onClick={() => handleRunJob(job)} />
|
||||
{/if}
|
||||
{/each}
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
</script>
|
||||
|
||||
{#if menuItem}
|
||||
<MenuOption text={$t('change_date')} icon={mdiCalendarEditOutline} on:click={() => (isShowChangeDate = true)} />
|
||||
<MenuOption text={$t('change_date')} icon={mdiCalendarEditOutline} onClick={() => (isShowChangeDate = true)} />
|
||||
{/if}
|
||||
{#if isShowChangeDate}
|
||||
<ChangeDate
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<MenuOption
|
||||
text={$t('change_location')}
|
||||
icon={mdiMapMarkerMultipleOutline}
|
||||
on:click={() => (isShowChangeLocation = true)}
|
||||
onClick={() => (isShowChangeLocation = true)}
|
||||
/>
|
||||
{/if}
|
||||
{#if isShowChangeLocation}
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
</script>
|
||||
|
||||
{#if menuItem}
|
||||
<MenuOption text={label} icon={mdiDeleteOutline} on:click={handleTrash} />
|
||||
<MenuOption text={label} icon={mdiDeleteOutline} onClick={handleTrash} />
|
||||
{:else if loading}
|
||||
<CircleIconButton title={$t('loading')} icon={mdiTimerSand} />
|
||||
{:else}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
</script>
|
||||
|
||||
{#if menuItem}
|
||||
<MenuOption text={$t('download')} icon={menuItemIcon} on:click={handleDownloadFiles} />
|
||||
<MenuOption text={$t('download')} icon={menuItemIcon} onClick={handleDownloadFiles} />
|
||||
{:else}
|
||||
<CircleIconButton title={$t('download')} icon={mdiCloudDownloadOutline} on:click={handleDownloadFiles} />
|
||||
{/if}
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
</script>
|
||||
|
||||
{#if menuItem}
|
||||
<MenuOption {text} {icon} on:click={handleFavorite} />
|
||||
<MenuOption {text} {icon} onClick={handleFavorite} />
|
||||
{/if}
|
||||
|
||||
{#if !menuItem}
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
</script>
|
||||
|
||||
{#if menuItem}
|
||||
<MenuOption text={$t('remove_from_album')} icon={mdiImageRemoveOutline} on:click={removeFromAlbum} />
|
||||
<MenuOption text={$t('remove_from_album')} icon={mdiImageRemoveOutline} onClick={removeFromAlbum} />
|
||||
{:else}
|
||||
<CircleIconButton title={$t('remove_from_album')} icon={mdiDeleteOutline} on:click={removeFromAlbum} />
|
||||
{/if}
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
</script>
|
||||
|
||||
{#if unstack}
|
||||
<MenuOption text={$t('unstack')} icon={mdiImageMinusOutline} on:click={handleUnstack} />
|
||||
<MenuOption text={$t('unstack')} icon={mdiImageMinusOutline} onClick={handleUnstack} />
|
||||
{:else}
|
||||
<MenuOption text={$t('stack')} icon={mdiImageMultipleOutline} on:click={handleStack} />
|
||||
<MenuOption text={$t('stack')} icon={mdiImageMultipleOutline} onClick={handleStack} />
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user