mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-07-07 20:44:34 +00:00
merge: merge the two post-form menus (!995)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/995 Approved-by: Marie <github@yuugi.dev> Approved-by: Hazelnoot <acomputerdog@gmail.com>
This commit is contained in:
commit
17a9b08f54
1 changed files with 20 additions and 27 deletions
|
@ -92,7 +92,6 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<button v-if="postFormActions.length > 0" v-tooltip="i18n.ts.plugins" class="_button" :class="$style.footerButton" @click="showActions"><i class="ti ti-plug"></i></button>
|
<button v-if="postFormActions.length > 0" v-tooltip="i18n.ts.plugins" class="_button" :class="$style.footerButton" @click="showActions"><i class="ti ti-plug"></i></button>
|
||||||
<button v-tooltip="i18n.ts.emoji" :class="['_button', $style.footerButton]" @click="insertEmoji"><i class="ti ti-mood-happy"></i></button>
|
<button v-tooltip="i18n.ts.emoji" :class="['_button', $style.footerButton]" @click="insertEmoji"><i class="ti ti-mood-happy"></i></button>
|
||||||
<button v-if="showAddMfmFunction" v-tooltip="i18n.ts.addMfmFunction" :class="['_button', $style.footerButton]" @click="insertMfmFunction"><i class="ti ti-palette"></i></button>
|
<button v-if="showAddMfmFunction" v-tooltip="i18n.ts.addMfmFunction" :class="['_button', $style.footerButton]" @click="insertMfmFunction"><i class="ti ti-palette"></i></button>
|
||||||
<button v-tooltip="i18n.ts.otherSettings" :class="['_button', $style.footerButton]" @click="showOtherMenu"><i class="ti ti-dots"></i></button>
|
|
||||||
</div>
|
</div>
|
||||||
<div :class="$style.footerRight">
|
<div :class="$style.footerRight">
|
||||||
<button v-tooltip="i18n.ts.previewNoteText" class="_button" :class="[$style.footerButton, { [$style.previewButtonActive]: showPreview }]" @click="showPreview = !showPreview"><i class="ti ti-eye"></i></button>
|
<button v-tooltip="i18n.ts.previewNoteText" class="_button" :class="[$style.footerButton, { [$style.previewButtonActive]: showPreview }]" @click="showPreview = !showPreview"><i class="ti ti-eye"></i></button>
|
||||||
|
@ -629,6 +628,26 @@ function showOtherSettings() {
|
||||||
},
|
},
|
||||||
}] satisfies MenuItem[];
|
}] satisfies MenuItem[];
|
||||||
|
|
||||||
|
if ($i.policies.scheduleNoteMax > 0) {
|
||||||
|
menuItems.push({ type: 'divider' }, {
|
||||||
|
type: 'button',
|
||||||
|
text: i18n.ts.schedulePost,
|
||||||
|
icon: 'ti ti-calendar-time',
|
||||||
|
action: toggleScheduleNote,
|
||||||
|
}, {
|
||||||
|
type: 'button',
|
||||||
|
text: i18n.ts.schedulePostList,
|
||||||
|
icon: 'ti ti-calendar-event',
|
||||||
|
action: () => {
|
||||||
|
const { dispose } = os.popup(defineAsyncComponent(() => import('@/components/MkSchedulePostListDialog.vue')), {}, {
|
||||||
|
closed: () => {
|
||||||
|
dispose();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
os.popupMenu(menuItems, otherSettingsButton.value);
|
os.popupMenu(menuItems, otherSettingsButton.value);
|
||||||
}
|
}
|
||||||
//#endregion
|
//#endregion
|
||||||
|
@ -1121,32 +1140,6 @@ function toggleScheduleNote() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function showOtherMenu(ev: MouseEvent) {
|
|
||||||
const menuItems: MenuItem[] = [];
|
|
||||||
|
|
||||||
if ($i.policies.scheduleNoteMax > 0) {
|
|
||||||
menuItems.push({
|
|
||||||
type: 'button',
|
|
||||||
text: i18n.ts.schedulePost,
|
|
||||||
icon: 'ti ti-calendar-time',
|
|
||||||
action: toggleScheduleNote,
|
|
||||||
}, {
|
|
||||||
type: 'button',
|
|
||||||
text: i18n.ts.schedulePostList,
|
|
||||||
icon: 'ti ti-calendar-event',
|
|
||||||
action: () => {
|
|
||||||
const { dispose } = os.popup(defineAsyncComponent(() => import('@/components/MkSchedulePostListDialog.vue')), {}, {
|
|
||||||
closed: () => {
|
|
||||||
dispose();
|
|
||||||
},
|
|
||||||
});
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
os.popupMenu(menuItems, ev.currentTarget ?? ev.target);
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (props.autofocus) {
|
if (props.autofocus) {
|
||||||
focus();
|
focus();
|
||||||
|
|
Loading…
Add table
Reference in a new issue