mirror of
				https://github.com/KevinMidboe/immich.git
				synced 2025-10-29 17:40:28 +00:00 
			
		
		
		
	fix(web): asset viewer navbar overlapping with details tab and context menu not closing on button press (except in album viewer) (#2323)
* fix overlapping of asset-viewer-nav-bar with details tab * fix contextmenu not closing on button press --------- Co-authored-by: faupau03 <paul.paffe@gmx.net>
This commit is contained in:
		| @@ -43,6 +43,7 @@ | |||||||
| 	import GalleryViewer from '../shared-components/gallery-viewer/gallery-viewer.svelte'; | 	import GalleryViewer from '../shared-components/gallery-viewer/gallery-viewer.svelte'; | ||||||
| 	import ImmichLogo from '../shared-components/immich-logo.svelte'; | 	import ImmichLogo from '../shared-components/immich-logo.svelte'; | ||||||
| 	import Button from '../elements/buttons/button.svelte'; | 	import Button from '../elements/buttons/button.svelte'; | ||||||
|  | 	import { clickOutside } from '$lib/utils/click-outside'; | ||||||
|  |  | ||||||
| 	export let album: AlbumResponseDto; | 	export let album: AlbumResponseDto; | ||||||
| 	export let sharedLink: SharedLinkResponseDto | undefined = undefined; | 	export let sharedLink: SharedLinkResponseDto | undefined = undefined; | ||||||
| @@ -457,12 +458,27 @@ | |||||||
| 					{/if} | 					{/if} | ||||||
|  |  | ||||||
| 					{#if !isPublicShared} | 					{#if !isPublicShared} | ||||||
|  | 						<div use:clickOutside on:outclick={() => (isShowAlbumOptions = false)}> | ||||||
| 							<CircleIconButton | 							<CircleIconButton | ||||||
| 								title="Album options" | 								title="Album options" | ||||||
| 								on:click={showAlbumOptionsMenu} | 								on:click={showAlbumOptionsMenu} | ||||||
| 								logo={DotsVertical} | 								logo={DotsVertical} | ||||||
|  | 								>{#if isShowAlbumOptions} | ||||||
|  | 									<ContextMenu {...contextMenuPosition}> | ||||||
|  | 										{#if isOwned} | ||||||
|  | 											<MenuOption | ||||||
|  | 												on:click={() => { | ||||||
|  | 													isShowThumbnailSelection = true; | ||||||
|  | 													isShowAlbumOptions = false; | ||||||
|  | 												}} | ||||||
|  | 												text="Set album cover" | ||||||
| 											/> | 											/> | ||||||
| 										{/if} | 										{/if} | ||||||
|  | 									</ContextMenu> | ||||||
|  | 								{/if} | ||||||
|  | 							</CircleIconButton> | ||||||
|  | 						</div> | ||||||
|  | 					{/if} | ||||||
|  |  | ||||||
| 					{#if isPublicShared} | 					{#if isPublicShared} | ||||||
| 						<ThemeButton /> | 						<ThemeButton /> | ||||||
| @@ -590,20 +606,6 @@ | |||||||
| 	/> | 	/> | ||||||
| {/if} | {/if} | ||||||
|  |  | ||||||
| {#if isShowAlbumOptions} |  | ||||||
| 	<ContextMenu {...contextMenuPosition} on:clickoutside={() => (isShowAlbumOptions = false)}> |  | ||||||
| 		{#if isOwned} |  | ||||||
| 			<MenuOption |  | ||||||
| 				on:click={() => { |  | ||||||
| 					isShowThumbnailSelection = true; |  | ||||||
| 					isShowAlbumOptions = false; |  | ||||||
| 				}} |  | ||||||
| 				text="Set album cover" |  | ||||||
| 			/> |  | ||||||
| 		{/if} |  | ||||||
| 	</ContextMenu> |  | ||||||
| {/if} |  | ||||||
|  |  | ||||||
| {#if isShowThumbnailSelection} | {#if isShowThumbnailSelection} | ||||||
| 	<ThumbnailSelection | 	<ThumbnailSelection | ||||||
| 		{album} | 		{album} | ||||||
|   | |||||||
| @@ -1,6 +1,7 @@ | |||||||
| <script lang="ts"> | <script lang="ts"> | ||||||
| 	import { createEventDispatcher, onMount } from 'svelte'; | 	import { createEventDispatcher, onMount } from 'svelte'; | ||||||
| 	import { AlbumResponseDto, api, UserResponseDto } from '@api'; | 	import { AlbumResponseDto, api, UserResponseDto } from '@api'; | ||||||
|  | 	import { clickOutside } from '$lib/utils/click-outside'; | ||||||
| 	import BaseModal from '../shared-components/base-modal.svelte'; | 	import BaseModal from '../shared-components/base-modal.svelte'; | ||||||
| 	import CircleAvatar from '../shared-components/circle-avatar.svelte'; | 	import CircleAvatar from '../shared-components/circle-avatar.svelte'; | ||||||
| 	import DotsVertical from 'svelte-material-icons/DotsVertical.svelte'; | 	import DotsVertical from 'svelte-material-icons/DotsVertical.svelte'; | ||||||
| @@ -84,13 +85,21 @@ | |||||||
|  |  | ||||||
| 				<div id={`icon-${user.id}`} class="flex place-items-center"> | 				<div id={`icon-${user.id}`} class="flex place-items-center"> | ||||||
| 					{#if isOwned} | 					{#if isOwned} | ||||||
|  | 						<div use:clickOutside on:outclick={() => (isShowMenu = false)}> | ||||||
| 							<CircleIconButton | 							<CircleIconButton | ||||||
| 								on:click={() => showContextMenu(user.id)} | 								on:click={() => showContextMenu(user.id)} | ||||||
| 								logo={DotsVertical} | 								logo={DotsVertical} | ||||||
| 								backgroundColor={'transparent'} | 								backgroundColor={'transparent'} | ||||||
| 								hoverColor={'#e2e7e9'} | 								hoverColor={'#e2e7e9'} | ||||||
| 								size={'20'} | 								size={'20'} | ||||||
| 						/> | 							> | ||||||
|  | 								{#if isShowMenu} | ||||||
|  | 									<ContextMenu {...position}> | ||||||
|  | 										<MenuOption on:click={() => removeUser(targetUserId)} text="Remove" /> | ||||||
|  | 									</ContextMenu> | ||||||
|  | 								{/if} | ||||||
|  | 							</CircleIconButton> | ||||||
|  | 						</div> | ||||||
| 					{:else if user.id == currentUser?.id} | 					{:else if user.id == currentUser?.id} | ||||||
| 						<button | 						<button | ||||||
| 							on:click={() => removeUser('me')} | 							on:click={() => removeUser('me')} | ||||||
| @@ -102,10 +111,4 @@ | |||||||
| 			</div> | 			</div> | ||||||
| 		{/each} | 		{/each} | ||||||
| 	</section> | 	</section> | ||||||
|  |  | ||||||
| 	{#if isShowMenu} |  | ||||||
| 		<ContextMenu {...position} on:clickoutside={() => (isShowMenu = false)}> |  | ||||||
| 			<MenuOption on:click={() => removeUser(targetUserId)} text="Remove" /> |  | ||||||
| 		</ContextMenu> |  | ||||||
| 	{/if} |  | ||||||
| </BaseModal> | </BaseModal> | ||||||
|   | |||||||
| @@ -1,6 +1,7 @@ | |||||||
| <script lang="ts"> | <script lang="ts"> | ||||||
| 	import { createEventDispatcher } from 'svelte'; | 	import { createEventDispatcher } from 'svelte'; | ||||||
|  |  | ||||||
|  | 	import { clickOutside } from '$lib/utils/click-outside'; | ||||||
| 	import ArrowLeft from 'svelte-material-icons/ArrowLeft.svelte'; | 	import ArrowLeft from 'svelte-material-icons/ArrowLeft.svelte'; | ||||||
| 	import CloudDownloadOutline from 'svelte-material-icons/CloudDownloadOutline.svelte'; | 	import CloudDownloadOutline from 'svelte-material-icons/CloudDownloadOutline.svelte'; | ||||||
| 	import InformationOutline from 'svelte-material-icons/InformationOutline.svelte'; | 	import InformationOutline from 'svelte-material-icons/InformationOutline.svelte'; | ||||||
| @@ -45,12 +46,12 @@ | |||||||
| </script> | </script> | ||||||
|  |  | ||||||
| <div | <div | ||||||
| 	class="h-16 flex justify-between place-items-center px-3 transition-transform duration-200 z-[9999]" | 	class="h-16 flex justify-between place-items-center px-3 transition-transform duration-200 z-[1001]" | ||||||
| > | > | ||||||
| 	<div> | 	<div> | ||||||
| 		<CircleIconButton logo={ArrowLeft} on:click={() => dispatch('goBack')} /> | 		<CircleIconButton logo={ArrowLeft} on:click={() => dispatch('goBack')} /> | ||||||
| 	</div> | 	</div> | ||||||
| 	<div class="text-white flex gap-2"> | 	<div class="text-white flex gap-2 justify-end w-[calc(100%-3rem)] overflow-hidden"> | ||||||
| 		{#if isOwner} | 		{#if isOwner} | ||||||
| 			<CircleIconButton | 			<CircleIconButton | ||||||
| 				logo={asset.isArchived ? ArchiveArrowUpOutline : ArchiveArrowDownOutline} | 				logo={asset.isArchived ? ArchiveArrowUpOutline : ArchiveArrowDownOutline} | ||||||
| @@ -107,16 +108,21 @@ | |||||||
|  |  | ||||||
| 		{#if isOwner} | 		{#if isOwner} | ||||||
| 			<CircleIconButton logo={DeleteOutline} on:click={() => dispatch('delete')} title="Delete" /> | 			<CircleIconButton logo={DeleteOutline} on:click={() => dispatch('delete')} title="Delete" /> | ||||||
| 			<CircleIconButton logo={DotsVertical} on:click={showOptionsMenu} title="More" /> | 			<div use:clickOutside on:outclick={() => (isShowAssetOptions = false)}> | ||||||
| 		{/if} | 				<CircleIconButton logo={DotsVertical} on:click={showOptionsMenu} title="More"> | ||||||
| 	</div> |  | ||||||
| </div> |  | ||||||
|  |  | ||||||
| 					{#if isShowAssetOptions} | 					{#if isShowAssetOptions} | ||||||
| 	<ContextMenu {...contextMenuPosition} on:clickoutside={() => (isShowAssetOptions = false)}> | 						<ContextMenu {...contextMenuPosition}> | ||||||
| 							<div class="flex flex-col rounded-lg "> | 							<div class="flex flex-col rounded-lg "> | ||||||
| 								<MenuOption on:click={() => onMenuClick('addToAlbum')} text="Add to Album" /> | 								<MenuOption on:click={() => onMenuClick('addToAlbum')} text="Add to Album" /> | ||||||
| 			<MenuOption on:click={() => onMenuClick('addToSharedAlbum')} text="Add to Shared Album" /> | 								<MenuOption | ||||||
|  | 									on:click={() => onMenuClick('addToSharedAlbum')} | ||||||
|  | 									text="Add to Shared Album" | ||||||
|  | 								/> | ||||||
| 							</div> | 							</div> | ||||||
| 						</ContextMenu> | 						</ContextMenu> | ||||||
| 					{/if} | 					{/if} | ||||||
|  | 				</CircleIconButton> | ||||||
|  | 			</div> | ||||||
|  | 		{/if} | ||||||
|  | 	</div> | ||||||
|  | </div> | ||||||
|   | |||||||
| @@ -391,7 +391,7 @@ | |||||||
| 		<div | 		<div | ||||||
| 			transition:fly={{ duration: 150 }} | 			transition:fly={{ duration: 150 }} | ||||||
| 			id="detail-panel" | 			id="detail-panel" | ||||||
| 			class="bg-immich-bg w-[360px] row-span-full transition-all overflow-y-auto dark:bg-immich-dark-bg dark:border-l dark:border-l-immich-dark-gray" | 			class="bg-immich-bg w-[360px] z-[1002] row-span-full transition-all overflow-y-auto dark:bg-immich-dark-bg dark:border-l dark:border-l-immich-dark-gray" | ||||||
| 			translate="yes" | 			translate="yes" | ||||||
| 		> | 		> | ||||||
| 			<DetailPanel | 			<DetailPanel | ||||||
|   | |||||||
| @@ -16,6 +16,7 @@ | |||||||
| 	on:click | 	on:click | ||||||
| > | > | ||||||
| 	<svelte:component this={logo} {size} /> | 	<svelte:component this={logo} {size} /> | ||||||
|  | 	<slot /> | ||||||
| </button> | </button> | ||||||
|  |  | ||||||
| <style> | <style> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user