mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-14 16:11:00 +08:00
This commit is contained in:
parent
7630cbb291
commit
e1569cf1ea
@ -16,7 +16,7 @@ export class Menu {
|
|||||||
const target = event.target as Element;
|
const target = event.target as Element;
|
||||||
if (isMobile()) {
|
if (isMobile()) {
|
||||||
const titleElement = hasClosestByClassName(target, "b3-menu__title");
|
const titleElement = hasClosestByClassName(target, "b3-menu__title");
|
||||||
if (titleElement) {
|
if (titleElement || (typeof event.detail === "string" && event.detail === "back")) {
|
||||||
const lastShowElements = this.element.querySelectorAll(".b3-menu__item--show");
|
const lastShowElements = this.element.querySelectorAll(".b3-menu__item--show");
|
||||||
if (lastShowElements.length > 0) {
|
if (lastShowElements.length > 0) {
|
||||||
lastShowElements[lastShowElements.length - 1].classList.remove("b3-menu__item--show");
|
lastShowElements[lastShowElements.length - 1].classList.remove("b3-menu__item--show");
|
||||||
|
@ -109,9 +109,14 @@ export const goForward = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const goBack = () => {
|
export const goBack = () => {
|
||||||
if (window.JSAndroid && window.siyuan.backStack.length < 1) {
|
if (window.JSAndroid) {
|
||||||
window.JSAndroid.returnDesktop();
|
if (window.siyuan.menus.menu.element.classList.contains("b3-menu--fullscreen") && !window.siyuan.menus.menu.element.classList.contains("fn__none")) {
|
||||||
return;
|
window.siyuan.menus.menu.element.dispatchEvent(new CustomEvent("click", {detail: "back"}))
|
||||||
|
return;
|
||||||
|
} else if (window.siyuan.backStack.length < 1) {
|
||||||
|
window.JSAndroid.returnDesktop();
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (window.siyuan.backStack.length < 1) {
|
if (window.siyuan.backStack.length < 1) {
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user