1
0
mirror of https://github.com/immich-app/immich.git synced 2025-06-28 05:18:38 +02:00

refactor(web): descriptions (#6517)

* refactor: reusable autogrow

* fix: remove useless autogrow

* fix: correct size for album description

* fix: format

* fix: move to own file

* refactor: album description

* refactor: asset description

* simplify

* fix: style when no description provided

* fix: switching assets

* feat: update description with ctrl + enter

* fix: variable name

* fix: styling

---------

Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
martin
2024-01-22 05:47:55 +01:00
committed by GitHub
parent 95cfe22866
commit 3845fec280
5 changed files with 97 additions and 124 deletions

View File

@ -19,6 +19,7 @@
import { NotificationType, notificationController } from '../shared-components/notification/notification';
import { getAssetType } from '$lib/utils/asset-utils';
import * as luxon from 'luxon';
import { autoGrowHeight } from '$lib/utils/autogrow';
const units: Intl.RelativeTimeFormatUnit[] = ['year', 'month', 'week', 'day', 'hour', 'minute', 'second'];
@ -98,11 +99,6 @@
}
};
const autoGrow = () => {
textArea.style.height = '5px';
textArea.style.height = textArea.scrollHeight + 'px';
};
const timeOptions = {
year: 'numeric',
month: '2-digit',
@ -293,7 +289,7 @@
bind:this={textArea}
bind:value={message}
placeholder={disabled ? 'Comments are disabled' : 'Say something'}
on:input={autoGrow}
on:input={() => autoGrowHeight(textArea)}
on:keypress={handleEnter}
class="h-[18px] {disabled
? 'cursor-not-allowed'