refactor(client): refacotr MkMediaCaption

This commit is contained in:
syuilo 2022-12-21 16:00:00 +09:00
parent 20fd9db77f
commit 689411c19a
5 changed files with 188 additions and 286 deletions

View file

@ -70,17 +70,12 @@ async function rename(file) {
}
async function describe(file) {
os.popup(defineAsyncComponent(() => import('@/components/MkMediaCaption.vue')), {
title: i18n.ts.describeFile,
input: {
placeholder: i18n.ts.inputNewDescription,
default: file.comment !== null ? file.comment : '',
},
image: file,
os.popup(defineAsyncComponent(() => import('@/components/MkFileCaptionEditWindow.vue')), {
default: file.comment !== null ? file.comment : '',
file: file,
}, {
done: result => {
if (!result || result.canceled) return;
let comment = result.result.length === 0 ? null : result.result;
done: caption => {
let comment = caption.length === 0 ? null : caption;
os.api('drive/files/update', {
fileId: file.id,
comment: comment,
@ -103,7 +98,7 @@ function showFileMenu(file, ev: MouseEvent) {
action: () => { toggleSensitive(file); },
}, {
text: i18n.ts.describeFile,
icon: 'ti ti-forms',
icon: 'ti ti-text-caption',
action: () => { describe(file); },
}, {
text: i18n.ts.attachCancel,