mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 01:50:12 +01:00
This commit is contained in:
parent
46bf69f792
commit
96a03115f1
3 changed files with 27 additions and 8 deletions
|
|
@ -42,7 +42,7 @@
|
||||||
|
|
||||||
.b3-menu {
|
.b3-menu {
|
||||||
&__submenu {
|
&__submenu {
|
||||||
top: 49px;
|
top: 48.5px;
|
||||||
left: 0;
|
left: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
max-height: none;
|
max-height: none;
|
||||||
|
|
|
||||||
|
|
@ -120,13 +120,18 @@ export class Menu {
|
||||||
setPosition(this.element, options.x - (isLeft ? window.siyuan.menus.menu.element.clientWidth : 0), options.y, options.h, options.w);
|
setPosition(this.element, options.x - (isLeft ? window.siyuan.menus.menu.element.clientWidth : 0), options.y, options.h, options.w);
|
||||||
}
|
}
|
||||||
|
|
||||||
public fullscreen() {
|
public fullscreen(position: "bottom" | "all" = "all") {
|
||||||
this.element.classList.add("b3-menu--fullscreen");
|
this.element.classList.add("b3-menu--fullscreen");
|
||||||
this.element.insertAdjacentHTML("afterbegin", `<div class="b3-menu__title">
|
this.element.insertAdjacentHTML("afterbegin", `<div class="b3-menu__title">
|
||||||
<svg class="b3-menu__icon"><use xlink:href="#iconLeft"></use></svg>
|
<svg class="b3-menu__icon"><use xlink:href="#iconLeft"></use></svg>
|
||||||
<span class="b3-menu__label">${window.siyuan.languages.back}</span>
|
<span class="b3-menu__label">${window.siyuan.languages.back}</span>
|
||||||
</div><button class="b3-menu__separator"></button>`);
|
</div><button class="b3-menu__separator"></button>`);
|
||||||
this.popup({x: 0, y: 0});
|
if (position === "bottom" ) {
|
||||||
|
this.element.querySelectorAll(".b3-menu__submenu").forEach((item:HTMLElement) => {
|
||||||
|
item.style.top = "calc(50vh + 48.5px)";
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this.popup({x: 0, y: position === "bottom" ? window.innerHeight / 2 : 0});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ import {unicode2Emoji} from "../../emoji";
|
||||||
import {mountHelp, newNotebook} from "../../util/mount";
|
import {mountHelp, newNotebook} from "../../util/mount";
|
||||||
import {confirmDialog} from "../../dialog/confirmDialog";
|
import {confirmDialog} from "../../dialog/confirmDialog";
|
||||||
import {newFile} from "../../util/newFile";
|
import {newFile} from "../../util/newFile";
|
||||||
|
import {isMobile} from "../../util/functions";
|
||||||
|
|
||||||
export class MobileFiles extends Model {
|
export class MobileFiles extends Model {
|
||||||
public element: HTMLElement;
|
public element: HTMLElement;
|
||||||
|
|
@ -175,15 +176,28 @@ export class MobileFiles extends Model {
|
||||||
if (type === "new") {
|
if (type === "new") {
|
||||||
newFile(notebookId, pathString);
|
newFile(notebookId, pathString);
|
||||||
} else if (type === "more-root") {
|
} else if (type === "more-root") {
|
||||||
initNavigationMenu(target.parentElement).popup({x, y});
|
initNavigationMenu(target.parentElement)
|
||||||
|
if (isMobile()) {
|
||||||
|
window.siyuan.menus.menu.fullscreen("bottom");
|
||||||
|
} else {
|
||||||
|
window.siyuan.menus.menu.popup({
|
||||||
|
x,
|
||||||
|
y
|
||||||
|
});
|
||||||
|
}
|
||||||
window.siyuan.menus.menu.element.style.zIndex = "310";
|
window.siyuan.menus.menu.element.style.zIndex = "310";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (type === "more-file") {
|
if (type === "more-file") {
|
||||||
initFileMenu(notebookId, pathString, target.parentElement).popup({
|
initFileMenu(notebookId, pathString, target.parentElement);
|
||||||
x,
|
if (isMobile()) {
|
||||||
y
|
window.siyuan.menus.menu.fullscreen("bottom");
|
||||||
});
|
} else {
|
||||||
|
window.siyuan.menus.menu.popup({
|
||||||
|
x,
|
||||||
|
y
|
||||||
|
});
|
||||||
|
}
|
||||||
window.siyuan.menus.menu.element.style.zIndex = "310";
|
window.siyuan.menus.menu.element.style.zIndex = "310";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue