mirror of
https://github.com/immich-app/immich.git
synced 2026-03-08 11:07:25 +03:00
refactor(web): remove events from clickOutside action (#9943)
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
import CircleIconButton from '$lib/components/elements/buttons/circle-icon-button.svelte';
|
||||
import MenuOption from '../../shared-components/context-menu/menu-option.svelte';
|
||||
import { getAssetControlContext } from '../asset-select-control-bar.svelte';
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
import { featureFlags } from '$lib/stores/server-config.store';
|
||||
import { mdiTimerSand, mdiDeleteOutline } from '@mdi/js';
|
||||
import { type OnDelete, deleteAssets } from '$lib/utils/actions';
|
||||
@@ -14,10 +13,6 @@
|
||||
|
||||
const { clearSelect, getOwnedAssets } = getAssetControlContext();
|
||||
|
||||
const dispatch = createEventDispatcher<{
|
||||
escape: void;
|
||||
}>();
|
||||
|
||||
let isShowConfirmation = false;
|
||||
let loading = false;
|
||||
|
||||
@@ -40,11 +35,6 @@
|
||||
isShowConfirmation = false;
|
||||
loading = false;
|
||||
};
|
||||
|
||||
const escape = () => {
|
||||
dispatch('escape');
|
||||
isShowConfirmation = false;
|
||||
};
|
||||
</script>
|
||||
|
||||
{#if menuItem}
|
||||
@@ -60,6 +50,5 @@
|
||||
size={getOwnedAssets().size}
|
||||
on:confirm={handleDelete}
|
||||
on:cancel={() => (isShowConfirmation = false)}
|
||||
on:escape={escape}
|
||||
/>
|
||||
{/if}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
setContext(() => (showContextMenu = false));
|
||||
</script>
|
||||
|
||||
<div use:clickOutside on:outclick={() => (showContextMenu = false)}>
|
||||
<div use:clickOutside={{ onOutclick: () => (showContextMenu = false) }}>
|
||||
<CircleIconButton {title} {icon} on:click={handleShowMenu} />
|
||||
{#if showContextMenu}
|
||||
<ContextMenu {...contextMenuPosition}>
|
||||
|
||||
Reference in New Issue
Block a user