Skip to content
Snippets Groups Projects
Commit f397146e authored by dakkar's avatar dakkar
Browse files

merge: Confirm alt text with Control + Enter (!608)

View MR for information: TransFem-org/Sharkey!608



Closes #612

Approved-by: default avatardakkar <dakkar@thenautilus.net>
Approved-by: default avatarMarie <github@yuugi.dev>
parents 9cf40ef4 717d22d4
Branches develop
No related tags found
No related merge requests found
Pipeline #1074 failed with stages
in 44 minutes
......@@ -17,7 +17,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<template #header>{{ i18n.ts.describeFile }}</template>
<MkSpacer :marginMin="20" :marginMax="28">
<MkDriveFileThumbnail :file="file" fit="contain" style="height: 193px; margin-bottom: 16px;"/>
<MkTextarea v-model="caption" autofocus :placeholder="i18n.ts.inputNewDescription">
<MkTextarea v-model="caption" autofocus :placeholder="i18n.ts.inputNewDescription" @keydown="onKeydown($event)">
<template #label>{{ i18n.ts.caption }}</template>
</MkTextarea>
</MkSpacer>
......@@ -46,6 +46,15 @@ const dialog = shallowRef<InstanceType<typeof MkModalWindow>>();
const caption = ref(props.default);
function onKeydown(ev: KeyboardEvent) {
if (ev.key === 'Enter' && (ev.ctrlKey || ev.metaKey)) ok();
if (ev.key === 'Escape') {
emit('closed');
dialog.value?.close();
}
}
async function ok() {
emit('done', caption.value);
dialog.value?.close();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment