From a773a564543c712bb596b236b450bcd9e3d75057 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Wed, 22 May 2024 17:13:20 +0800 Subject: [PATCH] :art: fix https://github.com/siyuan-note/siyuan/issues/11014 --- app/src/layout/Tab.ts | 3 ++- app/src/layout/Wnd.ts | 10 ++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/app/src/layout/Tab.ts b/app/src/layout/Tab.ts index 3067e4a38..9aacd94a3 100644 --- a/app/src/layout/Tab.ts +++ b/app/src/layout/Tab.ts @@ -7,7 +7,7 @@ import {Constants} from "../constants"; import {escapeGreat, escapeHtml} from "../util/escape"; import {unicode2Emoji} from "../emoji"; import {fetchPost} from "../util/fetch"; -import {showTooltip} from "../dialog/tooltip"; +import {hideTooltip, showTooltip} from "../dialog/tooltip"; import {isTouchDevice} from "../util/functions"; /// #if !BROWSER import {openNewWindow} from "../window/openNewWindow"; @@ -77,6 +77,7 @@ export class Tab { return; } window.getSelection().removeAllRanges(); + hideTooltip(); const tabElement = hasClosestByTag(event.target, "LI"); if (tabElement) { event.dataTransfer.setData("text/html", tabElement.outerHTML); diff --git a/app/src/layout/Wnd.ts b/app/src/layout/Wnd.ts index 527a4765a..1bee1396b 100644 --- a/app/src/layout/Wnd.ts +++ b/app/src/layout/Wnd.ts @@ -315,15 +315,13 @@ export class Wnd { const width = rect.width; const x = event.clientX - rect.left; const y = event.clientY - rect.top; - if ((x <= width / 3 && (y <= height / 8 || y >= height * 7 / 8)) || - (x <= width / 8 && (y > height / 8 || y < height * 7 / 8))) { + if (x <= width / 8 || (x <= width / 3 && x > width / 8 && y >= height / 8 && y <= height * 7 / 8)) { dragElement.setAttribute("style", "height:100%;width:50%;right:50%;bottom:0;left:0;top:0"); - } else if ((x > width * 2 / 3 && (y <= height / 8 || y >= height * 7 / 8)) || - (x >= width * 7 / 8 && (y > height / 8 || y < height * 7 / 8))) { + } else if (x >= width * 7 / 8 || (x >= width * 2 / 3 && x < width * 7 / 8 && y >= height / 8 && y <= height * 7 / 8)) { dragElement.setAttribute("style", "height:100%;width:50%;right:0;bottom:0;left:50%;top:0"); - } else if (x > width / 3 && x < width * 2 / 3 && y <= height / 8) { + } else if (y <= height / 8) { dragElement.setAttribute("style", "height:50%;width:100%;right:0;bottom:50%;left:0;top:0"); - } else if (x > width / 3 && x < width * 2 / 3 && y >= height * 7 / 8) { + } else if (y >= height * 7 / 8) { dragElement.setAttribute("style", "height:50%;width:100%;right:0;bottom:0;left:0;top:50%"); } else { dragElement.setAttribute("style", "height:100%;width:100%;right:0;bottom:0;top:0;left:0");