mirror of
https://example.com
synced 2024-11-29 01:46:39 +09:00
Merge pull request 'revert history api for now' (#10150) from Freeplay/calckey:history into develop
Reviewed-on: https://codeberg.org/calckey/calckey/pulls/10150
This commit is contained in:
commit
9f397dd29f
1 changed files with 12 additions and 12 deletions
|
@ -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({
|
||||
|
|
Loading…
Reference in a new issue