🚨
This commit is contained in:
parent
bdaf53f1bc
commit
a29bdf0a73
4 changed files with 16 additions and 18 deletions
|
@ -1,6 +1,5 @@
|
|||
import {App} from "../../index";
|
||||
import {windowMouseMove} from "./mousemove";
|
||||
import {Dialog} from "../../dialog";
|
||||
import {windowKeyUp} from "./keyup";
|
||||
import {windowKeyDown} from "./keydown";
|
||||
import {globalClick} from "./click";
|
||||
|
@ -83,7 +82,7 @@ export const initWindowEvent = (app: App) => {
|
|||
// dock right menu
|
||||
const dockElement = hasClosestByClassName(target, "dock__item");
|
||||
if (dockElement && dockElement.getAttribute("data-type")) {
|
||||
const dockRect = dockElement.getBoundingClientRect()
|
||||
const dockRect = dockElement.getBoundingClientRect();
|
||||
initDockMenu(dockElement).popup({x: dockRect.right, y: dockRect.top});
|
||||
event.stopImmediatePropagation();
|
||||
event.preventDefault();
|
||||
|
@ -93,12 +92,12 @@ export const initWindowEvent = (app: App) => {
|
|||
// tab right menu
|
||||
const tabElement = hasClosestByAttribute(target, "data-type", "tab-header");
|
||||
if (tabElement) {
|
||||
const tabRect = tabElement.getBoundingClientRect()
|
||||
const tabRect = tabElement.getBoundingClientRect();
|
||||
initTabMenu(app, (getInstanceById(tabElement.getAttribute("data-id")) as Tab)).popup({
|
||||
x: tabRect.left,
|
||||
y: tabRect.bottom
|
||||
});
|
||||
hideTooltip()
|
||||
hideTooltip();
|
||||
event.stopImmediatePropagation();
|
||||
event.preventDefault();
|
||||
return;
|
||||
|
|
|
@ -815,7 +815,7 @@ const panelTreeKeydown = (app: App, event: KeyboardEvent) => {
|
|||
return false;
|
||||
};
|
||||
|
||||
let switchDialog: Dialog
|
||||
let switchDialog: Dialog;
|
||||
export const windowKeyDown = (app: App, event: KeyboardEvent) => {
|
||||
if (document.querySelector(".av__mask") || document.getElementById("errorLog") || event.isComposing) {
|
||||
return;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {isIPad, isIPhone} from "../../protyle/util/compatibility";
|
||||
import {isIPad} from "../../protyle/util/compatibility";
|
||||
import {hasClosestByAttribute, hasClosestByClassName, hasTopClosestByTag} from "../../protyle/util/hasClosest";
|
||||
import {initFileMenu, initNavigationMenu} from "../../menus/navigation";
|
||||
import {fileAnnotationRefMenu, linkMenu, refMenu, tagMenu} from "../../menus/protyle";
|
||||
|
@ -21,9 +21,9 @@ export const globalTouchEnd = (event: TouchEvent, yDiff: number, time: number, a
|
|||
if (!window.siyuan.config.readonly && fileItemElement.dataset.type === "navigation-root") {
|
||||
const menu = initNavigationMenu(app, fileItemElement);
|
||||
if (isIPadBoolean) {
|
||||
const rect = fileItemElement.getBoundingClientRect()
|
||||
menu.popup({x: rect.right - 52, y: rect.bottom, h: rect.height})
|
||||
hideTooltip()
|
||||
const rect = fileItemElement.getBoundingClientRect();
|
||||
menu.popup({x: rect.right - 52, y: rect.bottom, h: rect.height});
|
||||
hideTooltip();
|
||||
} else {
|
||||
window.siyuan.menus.menu.fullscreen("bottom");
|
||||
}
|
||||
|
@ -32,9 +32,9 @@ export const globalTouchEnd = (event: TouchEvent, yDiff: number, time: number, a
|
|||
if (rootElement) {
|
||||
const menu = initFileMenu(app, rootElement.dataset.url, fileItemElement.dataset.path, fileItemElement);
|
||||
if (isIPadBoolean) {
|
||||
const rect = fileItemElement.getBoundingClientRect()
|
||||
menu.popup({x: rect.right - 52, y: rect.bottom, h: rect.height})
|
||||
hideTooltip()
|
||||
const rect = fileItemElement.getBoundingClientRect();
|
||||
menu.popup({x: rect.right - 52, y: rect.bottom, h: rect.height});
|
||||
hideTooltip();
|
||||
} else {
|
||||
window.siyuan.menus.menu.fullscreen("bottom");
|
||||
}
|
||||
|
@ -44,13 +44,13 @@ export const globalTouchEnd = (event: TouchEvent, yDiff: number, time: number, a
|
|||
}
|
||||
// 内元素弹出菜单
|
||||
if (target.tagName === "SPAN" && !hasClosestByAttribute(target, "data-type", "NodeBlockQueryEmbed")) {
|
||||
let editor: Protyle
|
||||
let editor: Protyle;
|
||||
if (isIPadBoolean) {
|
||||
const tabContainerElement = hasClosestByClassName(target, "protyle", true)
|
||||
const tabContainerElement = hasClosestByClassName(target, "protyle", true);
|
||||
if (tabContainerElement) {
|
||||
const tab = getInstanceById(tabContainerElement.dataset.id);
|
||||
if (tab instanceof Tab && tab.model instanceof Editor) {
|
||||
editor = tab.model.editor
|
||||
editor = tab.model.editor;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -88,5 +88,5 @@ export const globalTouchEnd = (event: TouchEvent, yDiff: number, time: number, a
|
|||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
|
|
@ -2,7 +2,6 @@ import {
|
|||
hasClosestByAttribute,
|
||||
hasClosestByClassName,
|
||||
hasTopClosestByClassName,
|
||||
hasTopClosestByTag
|
||||
} from "../../protyle/util/hasClosest";
|
||||
import {closePanel} from "./closePanel";
|
||||
import {popMenu} from "../menu";
|
||||
|
|
Loading…
Add table
Reference in a new issue