Vanessa 2024-05-22 17:13:20 +08:00
parent 17b69f9a50
commit a773a56454
2 changed files with 6 additions and 7 deletions

View File

@ -7,7 +7,7 @@ import {Constants} from "../constants";
import {escapeGreat, escapeHtml} from "../util/escape"; import {escapeGreat, escapeHtml} from "../util/escape";
import {unicode2Emoji} from "../emoji"; import {unicode2Emoji} from "../emoji";
import {fetchPost} from "../util/fetch"; import {fetchPost} from "../util/fetch";
import {showTooltip} from "../dialog/tooltip"; import {hideTooltip, showTooltip} from "../dialog/tooltip";
import {isTouchDevice} from "../util/functions"; import {isTouchDevice} from "../util/functions";
/// #if !BROWSER /// #if !BROWSER
import {openNewWindow} from "../window/openNewWindow"; import {openNewWindow} from "../window/openNewWindow";
@ -77,6 +77,7 @@ export class Tab {
return; return;
} }
window.getSelection().removeAllRanges(); window.getSelection().removeAllRanges();
hideTooltip();
const tabElement = hasClosestByTag(event.target, "LI"); const tabElement = hasClosestByTag(event.target, "LI");
if (tabElement) { if (tabElement) {
event.dataTransfer.setData("text/html", tabElement.outerHTML); event.dataTransfer.setData("text/html", tabElement.outerHTML);

View File

@ -315,15 +315,13 @@ export class Wnd {
const width = rect.width; const width = rect.width;
const x = event.clientX - rect.left; const x = event.clientX - rect.left;
const y = event.clientY - rect.top; const y = event.clientY - rect.top;
if ((x <= width / 3 && (y <= height / 8 || y >= height * 7 / 8)) || if (x <= width / 8 || (x <= width / 3 && x > width / 8 && y >= height / 8 && y <= height * 7 / 8)) {
(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"); 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)) || } else if (x >= width * 7 / 8 || (x >= width * 2 / 3 && x < width * 7 / 8 && y >= height / 8 && y <= height * 7 / 8)) {
(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"); 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"); 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%"); dragElement.setAttribute("style", "height:50%;width:100%;right:0;bottom:0;left:0;top:50%");
} else { } else {
dragElement.setAttribute("style", "height:100%;width:100%;right:0;bottom:0;top:0;left:0"); dragElement.setAttribute("style", "height:100%;width:100%;right:0;bottom:0;top:0;left:0");