mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-30 11:03:08 +02:00
refactor
This commit is contained in:
parent
bfc9873fb9
commit
974269b8f1
5 changed files with 10 additions and 8 deletions
|
@ -95,7 +95,7 @@ function onClick(ev: MouseEvent) {
|
|||
if (props.selectMode) {
|
||||
emit('chosen', props.file);
|
||||
} else {
|
||||
os.popupMenu(getMenu(), (ev.currentTarget ?? ev.target || undefined) as HTMLElement | undefined);
|
||||
os.popupMenu(getMenu(), (ev.currentTarget ?? ev.target ?? undefined) as HTMLElement | undefined);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -591,7 +591,7 @@ function getMenu() {
|
|||
}
|
||||
|
||||
function showMenu(ev: MouseEvent) {
|
||||
os.popupMenu(getMenu(), (ev.currentTarget ?? ev.target || undefined) as HTMLElement | undefined);
|
||||
os.popupMenu(getMenu(), (ev.currentTarget ?? ev.target ?? undefined) as HTMLElement | undefined);
|
||||
}
|
||||
|
||||
function onContextmenu(ev: MouseEvent) {
|
||||
|
|
|
@ -43,9 +43,9 @@ withDefaults(defineProps<{
|
|||
});
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'done', v: any): void;
|
||||
(e: 'close'): void;
|
||||
(e: 'closed'): void;
|
||||
(ev: 'done', v: any): void;
|
||||
(ev: 'close'): void;
|
||||
(ev: 'closed'): void;
|
||||
}>();
|
||||
|
||||
const modal = ref<InstanceType<typeof MkModal>>();
|
||||
|
|
|
@ -25,11 +25,13 @@ function getFixedContainer(el: Element | null): Element | null {
|
|||
}
|
||||
}
|
||||
|
||||
type ModalTypes = 'popup' | 'dialog' | 'drawer';
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
manualShowing?: boolean;
|
||||
srcCenter?: boolean;
|
||||
src?: HTMLElement;
|
||||
preferType?: string;
|
||||
preferType?: ModalTypes | 'auto';
|
||||
zPriority?: 'low' | 'middle' | 'high';
|
||||
noOverlap?: boolean;
|
||||
transparentBg?: boolean;
|
||||
|
@ -66,7 +68,7 @@ const type = computed(() => {
|
|||
return props.src != null ? 'popup' : 'dialog';
|
||||
}
|
||||
} else {
|
||||
return props.preferType;
|
||||
return props.preferType!;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -403,7 +403,7 @@ export async function selectDriveFolder(multiple: boolean) {
|
|||
});
|
||||
}
|
||||
|
||||
export async function pickEmoji(src?: HTMLElement, opts) {
|
||||
export async function pickEmoji(src: HTMLElement | null, opts) {
|
||||
return new Promise((resolve, reject) => {
|
||||
popup(import('@/components/emoji-picker-dialog.vue'), {
|
||||
src,
|
||||
|
|
Loading…
Reference in a new issue