mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🔖 Release v3.0.7
This commit is contained in:
parent
27f0586d1f
commit
5807ce7d35
5 changed files with 13 additions and 17 deletions
|
|
@ -6,13 +6,13 @@ import {writeText} from "../../protyle/util/compatibility";
|
|||
import {showMessage} from "../../dialog/message";
|
||||
|
||||
export const globalClick = (event: MouseEvent & { target: HTMLElement }) => {
|
||||
const ghostElement = document.getElementById("dragGhost")
|
||||
const ghostElement = document.getElementById("dragGhost");
|
||||
if (ghostElement) {
|
||||
const startElement = ghostElement.parentElement.querySelector(`[data-node-id="${ghostElement.getAttribute("data-node-id")}"]`) as HTMLElement
|
||||
startElement ? startElement.style.opacity = "" : ""
|
||||
const startElement = ghostElement.parentElement.querySelector(`[data-node-id="${ghostElement.getAttribute("data-node-id")}"]`) as HTMLElement;
|
||||
startElement ? startElement.style.opacity = "" : "";
|
||||
ghostElement.parentElement.querySelectorAll(".dragover__top, .dragover__bottom, .dragover").forEach((item: HTMLElement) => {
|
||||
item.classList.remove("dragover__top", "dragover__bottom", "dragover");
|
||||
item.style.opacity = ""
|
||||
item.style.opacity = "";
|
||||
});
|
||||
ghostElement.remove();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -234,7 +234,7 @@ export class Outline extends Model {
|
|||
}
|
||||
const documentSelf = document;
|
||||
documentSelf.ondragstart = () => false;
|
||||
let ghostElement: HTMLElement
|
||||
let ghostElement: HTMLElement;
|
||||
let selectItem: HTMLElement;
|
||||
documentSelf.onmousemove = (moveEvent: MouseEvent) => {
|
||||
if (moveEvent.clientY === event.clientY && moveEvent.clientX === event.clientX) {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,4 @@
|
|||
import {
|
||||
hasClosestByAttribute,
|
||||
hasClosestByClassName,
|
||||
hasTopClosestByClassName,
|
||||
} from "../../protyle/util/hasClosest";
|
||||
import {hasClosestByAttribute, hasClosestByClassName, hasTopClosestByClassName,} from "../../protyle/util/hasClosest";
|
||||
import {closeModel, closePanel} from "./closePanel";
|
||||
import {popMenu} from "../menu";
|
||||
import {activeBlur, hideKeyboardToolbar} from "./keyboardToolbar";
|
||||
|
|
@ -160,7 +156,7 @@ export const handleTouchStart = (event: TouchEvent) => {
|
|||
};
|
||||
|
||||
let previousClientX: number;
|
||||
const sideMaskElement = document.querySelector(".side-mask") as HTMLElement
|
||||
const sideMaskElement = document.querySelector(".side-mask") as HTMLElement;
|
||||
export const handleTouchMove = (event: TouchEvent) => {
|
||||
const target = event.target as HTMLElement;
|
||||
if (!clientX || !clientY ||
|
||||
|
|
@ -189,15 +185,15 @@ export const handleTouchMove = (event: TouchEvent) => {
|
|||
// 上下滚动防止左右滑动
|
||||
if (!firstXY) {
|
||||
if (Math.abs(xDiff) > Math.abs(yDiff)) {
|
||||
firstXY = "x"
|
||||
firstXY = "x";
|
||||
} else {
|
||||
firstXY = "y"
|
||||
firstXY = "y";
|
||||
}
|
||||
if (firstXY === "x") {
|
||||
if ((hasClosestByAttribute(target, "id", "menu") && firstDirection === "toLeft") ||
|
||||
(hasClosestByAttribute(target, "id", "sidebar") && firstDirection === "toRight")) {
|
||||
firstXY = "y"
|
||||
yDiff = undefined
|
||||
firstXY = "y";
|
||||
yDiff = undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -420,7 +420,7 @@ export class WYSIWYG {
|
|||
documentSelf.onmousemove = (moveEvent: MouseEvent) => {
|
||||
newWidth = Math.max(oldWidth + (moveEvent.clientX - event.clientX), 25);
|
||||
scrollElement.querySelectorAll(".av__row, .av__row--footer").forEach(item => {
|
||||
const cellElement = item.querySelector(`[data-col-id="${dragColId}"]`) as HTMLElement
|
||||
const cellElement = item.querySelector(`[data-col-id="${dragColId}"]`) as HTMLElement;
|
||||
if (cellElement.previousElementSibling) {
|
||||
cellElement.style.width = newWidth + "px";
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -676,7 +676,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
|
|||
if (event.key === "ArrowDown") {
|
||||
if (nodeElement.isSameNode(protyle.wysiwyg.element.lastElementChild)) {
|
||||
setLastNodeRange(getContenteditableElement(nodeEditableElement), range, false);
|
||||
range.collapse(false)
|
||||
range.collapse(false);
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue