From f3931c9087912bffeacd970b41d82431213b88c7 Mon Sep 17 00:00:00 2001 From: Freeplay Date: Thu, 18 May 2023 11:48:45 -0400 Subject: [PATCH] revert history api --- packages/client/src/components/MkModal.vue | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/client/src/components/MkModal.vue b/packages/client/src/components/MkModal.vue index 287fb1d8c..fa80c35b8 100644 --- a/packages/client/src/components/MkModal.vue +++ b/packages/client/src/components/MkModal.vue @@ -177,10 +177,10 @@ let contentClicking = false; const focusedElement = document.activeElement; function close(ev, opts: { useSendAnimation?: boolean } = {}) { - removeEventListener("popstate", close); - if (props.preferType == "dialog") { - history.forward(); - } + // removeEventListener("popstate", close); + // if (props.preferType == "dialog") { + // history.forward(); + // } if (opts.useSendAnimation) { useSendAnime = true; } @@ -358,10 +358,10 @@ const onOpened = () => { }, { passive: true } ); - if (props.preferType == "dialog") { - history.pushState(null, "", location.href); - } - addEventListener("popstate", close); + // if (props.preferType == "dialog") { + // history.pushState(null, "", location.href); + // } + // addEventListener("popstate", close); }; onMounted(() => { @@ -388,10 +388,10 @@ onMounted(() => { }); }); onUnmounted(() => { - removeEventListener("popstate", close); - if (props.preferType == "dialog") { - history.back(); - } + // removeEventListener("popstate", close); + // if (props.preferType == "dialog") { + // history.back(); + // } }); defineExpose({