1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-16 00:36:47 +01:00

wip: recalculate position when the title changes

This commit is contained in:
ben-basten 2024-10-13 23:06:15 -04:00
parent 3baebff162
commit 6c9ea9f7f4
No known key found for this signature in database
GPG key ID: 78803E894B258348

View file

@ -84,6 +84,7 @@
$: colorClass = colorClasses[color];
$: mobileClass = hideMobile ? 'hidden sm:flex' : '';
$: paddingClass = paddingClasses[padding];
$: recalculatePosition(title);
const id = $$restProps.id ?? generateId();
@ -124,6 +125,12 @@
left = box.left + box.width / 2 - offsetWidth / 2;
});
};
const recalculatePosition = (title: string) => {
if (showPopover && title) {
onShowPopover();
}
};
</script>
<!-- svelte-ignore a11y-no-static-element-interactions -->