mirror of
https://github.com/immich-app/immich.git
synced 2025-09-29 15:31:13 -04:00
- add initial viewer button UI
This commit is contained in:
parent
5fb0afb0d0
commit
52903e510e
@ -11,6 +11,7 @@
|
|||||||
mdiCameraBurst,
|
mdiCameraBurst,
|
||||||
mdiCheckCircle,
|
mdiCheckCircle,
|
||||||
mdiHeart,
|
mdiHeart,
|
||||||
|
mdiMagnifyPlusOutline,
|
||||||
mdiMotionPauseOutline,
|
mdiMotionPauseOutline,
|
||||||
mdiMotionPlayOutline,
|
mdiMotionPlayOutline,
|
||||||
mdiRotate360,
|
mdiRotate360,
|
||||||
@ -37,6 +38,7 @@
|
|||||||
thumbnailHeight?: number;
|
thumbnailHeight?: number;
|
||||||
selected?: boolean;
|
selected?: boolean;
|
||||||
selectionCandidate?: boolean;
|
selectionCandidate?: boolean;
|
||||||
|
selectionActive?: boolean;
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
disableLinkMouseOver?: boolean;
|
disableLinkMouseOver?: boolean;
|
||||||
readonly?: boolean;
|
readonly?: boolean;
|
||||||
@ -45,7 +47,7 @@
|
|||||||
imageClass?: ClassValue;
|
imageClass?: ClassValue;
|
||||||
brokenAssetClass?: ClassValue;
|
brokenAssetClass?: ClassValue;
|
||||||
dimmed?: boolean;
|
dimmed?: boolean;
|
||||||
onClick?: (asset: TimelineAsset) => void;
|
onClick?: (asset: TimelineAsset, forceView?: boolean) => void;
|
||||||
onSelect?: (asset: TimelineAsset) => void;
|
onSelect?: (asset: TimelineAsset) => void;
|
||||||
onMouseEvent?: (event: { isMouseOver: boolean; selectedGroupIndex: number }) => void;
|
onMouseEvent?: (event: { isMouseOver: boolean; selectedGroupIndex: number }) => void;
|
||||||
}
|
}
|
||||||
@ -58,6 +60,7 @@
|
|||||||
thumbnailHeight = undefined,
|
thumbnailHeight = undefined,
|
||||||
selected = false,
|
selected = false,
|
||||||
selectionCandidate = false,
|
selectionCandidate = false,
|
||||||
|
selectionActive = false,
|
||||||
disabled = false,
|
disabled = false,
|
||||||
disableLinkMouseOver = false,
|
disableLinkMouseOver = false,
|
||||||
readonly = false,
|
readonly = false,
|
||||||
@ -92,6 +95,12 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const onViewerIconClickedHandler = (e?: MouseEvent) => {
|
||||||
|
e?.stopPropagation();
|
||||||
|
e?.preventDefault();
|
||||||
|
onClick?.($state.snapshot(asset), true);
|
||||||
|
};
|
||||||
|
|
||||||
const callClickHandlers = () => {
|
const callClickHandlers = () => {
|
||||||
if (selected) {
|
if (selected) {
|
||||||
onIconClickedHandler();
|
onIconClickedHandler();
|
||||||
@ -310,6 +319,19 @@
|
|||||||
</a>
|
</a>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
<!-- View Asset while selecting -->
|
||||||
|
{#if mouseOver && selectionActive}
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onclick={onViewerIconClickedHandler}
|
||||||
|
class={['absolute focus:outline-none bottom-2 end-2', { 'cursor-not-allowed': disabled }]}
|
||||||
|
tabindex={-1}
|
||||||
|
{disabled}
|
||||||
|
>
|
||||||
|
<Icon path={mdiMagnifyPlusOutline} size="24" class="text-white/80 hover:text-white" />
|
||||||
|
</button>
|
||||||
|
{/if}
|
||||||
|
|
||||||
<ImageThumbnail
|
<ImageThumbnail
|
||||||
class={imageClass}
|
class={imageClass}
|
||||||
{brokenAssetClass}
|
{brokenAssetClass}
|
||||||
|
@ -75,8 +75,9 @@
|
|||||||
assets: TimelineAsset[],
|
assets: TimelineAsset[],
|
||||||
groupTitle: string,
|
groupTitle: string,
|
||||||
asset: TimelineAsset,
|
asset: TimelineAsset,
|
||||||
|
forceView: boolean = false,
|
||||||
) => {
|
) => {
|
||||||
if (isSelectionMode || assetInteraction.selectionActive) {
|
if (!forceView && (isSelectionMode || assetInteraction.selectionActive)) {
|
||||||
assetSelectHandler(timelineManager, asset, assets, groupTitle);
|
assetSelectHandler(timelineManager, asset, assets, groupTitle);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -218,11 +219,11 @@
|
|||||||
{showArchiveIcon}
|
{showArchiveIcon}
|
||||||
{asset}
|
{asset}
|
||||||
{groupIndex}
|
{groupIndex}
|
||||||
onClick={(asset) => {
|
onClick={(asset, forceView:boolean = false) => {
|
||||||
if (typeof onThumbnailClick === 'function') {
|
if (typeof onThumbnailClick === 'function') {
|
||||||
onThumbnailClick(asset, timelineManager, dayGroup, _onClick);
|
onThumbnailClick(asset, timelineManager, dayGroup, _onClick);
|
||||||
} else {
|
} else {
|
||||||
_onClick(timelineManager, dayGroup.getAssets(), dayGroup.groupTitle, asset);
|
_onClick(timelineManager, dayGroup.getAssets(), dayGroup.groupTitle, asset, forceView);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
onSelect={(asset) => assetSelectHandler(timelineManager, asset, dayGroup.getAssets(), dayGroup.groupTitle)}
|
onSelect={(asset) => assetSelectHandler(timelineManager, asset, dayGroup.getAssets(), dayGroup.groupTitle)}
|
||||||
@ -230,6 +231,7 @@
|
|||||||
selected={assetInteraction.hasSelectedAsset(asset.id) ||
|
selected={assetInteraction.hasSelectedAsset(asset.id) ||
|
||||||
dayGroup.monthGroup.timelineManager.albumAssets.has(asset.id)}
|
dayGroup.monthGroup.timelineManager.albumAssets.has(asset.id)}
|
||||||
selectionCandidate={assetInteraction.hasSelectionCandidate(asset.id)}
|
selectionCandidate={assetInteraction.hasSelectionCandidate(asset.id)}
|
||||||
|
selectionActive={assetInteraction.selectionActive}
|
||||||
disabled={dayGroup.monthGroup.timelineManager.albumAssets.has(asset.id)}
|
disabled={dayGroup.monthGroup.timelineManager.albumAssets.has(asset.id)}
|
||||||
thumbnailWidth={position.width}
|
thumbnailWidth={position.width}
|
||||||
thumbnailHeight={position.height}
|
thumbnailHeight={position.height}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user