From 6d42caef44ad3bb358b13c4a7e95b4799d9e5d6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Tomaszewski?= Date: Tue, 30 Aug 2022 10:54:43 +0200 Subject: [PATCH] i have no fucking clue why this file made all of this break --- packages/client/src/components/ui/window.vue | 56 +++----------------- 1 file changed, 7 insertions(+), 49 deletions(-) diff --git a/packages/client/src/components/ui/window.vue b/packages/client/src/components/ui/window.vue index 4fa90c8ca..40936f4c4 100644 --- a/packages/client/src/components/ui/window.vue +++ b/packages/client/src/components/ui/window.vue @@ -36,7 +36,6 @@ import { onMounted, onUnmounted, provide } from 'vue'; import contains from '@/scripts/contains'; import * as os from '@/os'; -import { MenuItem } from '@/types/menu'; const minHeight = 50; const minWidth = 250; @@ -58,48 +57,10 @@ function addTouchListener(fn: (this: Window, ev: TouchEvent) => void): void { window.addEventListener('touchend', removeTouchListener.bind(null, fn)); } - props: { - initialWidth: { - type: Number, - required: false, - default: 400, - }, - initialHeight: { - type: Number, - required: false, - default: null, - }, - canResize: { - type: Boolean, - required: false, - default: false, - }, - closeButton: { - type: Boolean, - required: false, - default: true, - }, - mini: { - type: Boolean, - required: false, - default: false, - }, - front: { - type: Boolean, - required: false, - default: false, - }, - buttonsLeft: { - type: Array, - required: false, - default: () => [], - }, - buttonsRight: { - type: Array, - required: false, - default: () => [], - }, - }, +function removeTouchListener(fn: (this: Window, ev: TouchEvent) => void): void { + window.removeEventListener('touchmove', fn); + window.removeEventListener('touchend', removeTouchListener.bind(null, fn)); +} const props = withDefaults(defineProps<{ initialWidth?: number; @@ -108,7 +69,6 @@ const props = withDefaults(defineProps<{ closeButton?: boolean; mini?: boolean; front?: boolean; - contextmenu?: MenuItem[]; buttonsLeft?: any[]; buttonsRight?: any[]; }>(), { @@ -117,7 +77,6 @@ const props = withDefaults(defineProps<{ closeButton: true, mini: false, front: false, - contextmenu: () => [] as MenuItem[], buttonsLeft: () => [], buttonsRight: () => [], }); @@ -159,10 +118,9 @@ function onKeydown(evt: KeyboardEvent): void { } } - // 最前面へ移動 - top() { - (this.$el as any).style.zIndex = os.claimZIndex(this.front ? 'middle' : 'low'); - }, +function moveToTop(): void { + main.style.zIndex = os.claimZIndex(props.front ? 'middle' : 'low').toString(); +} function getClickPos(evt: MouseEvent | TouchEvent): [number, number] { if (evt instanceof MouseEvent) {