diff --git a/web/src/lib/components/photos-page/asset-grid-actions.svelte b/web/src/lib/components/photos-page/asset-grid-actions.svelte new file mode 100644 index 0000000000..2087bc1d74 --- /dev/null +++ b/web/src/lib/components/photos-page/asset-grid-actions.svelte @@ -0,0 +1,216 @@ + + + + +{#if isShowDeleteConfirmation} + (isShowDeleteConfirmation = false)} + onConfirm={() => handlePromiseError(trashOrDelete(true))} + /> +{/if} + +{#if isShowSelectDate} + { + isShowSelectDate = false; + if (result.mode === 'absolute') { + const asset = await timelineManager.getClosestAssetToDate( + (DateTime.fromISO(result.date) as DateTime).toObject(), + ); + if (asset) { + setFocusAsset(asset); + } + } + }} + onCancel={() => (isShowSelectDate = false)} + /> +{/if} diff --git a/web/src/lib/components/photos-page/asset-grid.svelte b/web/src/lib/components/photos-page/asset-grid.svelte index 6db7fbda8b..2c91e4fe3c 100644 --- a/web/src/lib/components/photos-page/asset-grid.svelte +++ b/web/src/lib/components/photos-page/asset-grid.svelte @@ -1,42 +1,26 @@ - - -{#if isShowDeleteConfirmation} - (isShowDeleteConfirmation = false)} - onConfirm={() => handlePromiseError(trashOrDelete(true))} - /> -{/if} - -{#if isShowSelectDate} - { - isShowSelectDate = false; - const asset = await timelineManager.getClosestAssetToDate( - (DateTime.fromISO(dateString) as DateTime).toObject(), - ); - if (asset) { - setFocusAsset(asset); - } - }} - onCancel={() => (isShowSelectDate = false)} - /> -{/if} + {#if timelineManager.months.length > 0} { - evt.preventDefault(); - let amount = 50; - if (shiftKeyIsDown) { - amount = 500; - } - if (evt.key === 'ArrowUp') { - amount = -amount; - if (shiftKeyIsDown) { - element?.scrollBy({ top: amount, behavior: 'smooth' }); - } - } else if (evt.key === 'ArrowDown') { - element?.scrollBy({ top: amount, behavior: 'smooth' }); - } - }} /> {/if}