mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-12 10:14:21 +01:00
This commit is contained in:
parent
d0ad863651
commit
b222fdfac3
4 changed files with 13 additions and 6 deletions
|
|
@ -8,7 +8,7 @@ import {escapeGreat, escapeHtml} from "../util/escape";
|
|||
import {unicode2Emoji} from "../emoji";
|
||||
import {fetchPost} from "../util/fetch";
|
||||
import {hideTooltip, showTooltip} from "../dialog/tooltip";
|
||||
import {isTouchDevice} from "../util/functions";
|
||||
import {isTouchDevice, isWindow} from "../util/functions";
|
||||
/// #if !BROWSER
|
||||
import {openNewWindow} from "../window/openNewWindow";
|
||||
import {ipcRenderer} from "electron";
|
||||
|
|
@ -99,6 +99,9 @@ export class Tab {
|
|||
tabElement.style.opacity = "0.38";
|
||||
window.siyuan.dragElement = this.headElement;
|
||||
}
|
||||
if (isWindow() && this.headElement.getBoundingClientRect().top <= 0) {
|
||||
((this.headElement.parentElement.parentElement.querySelector(".item--readonly .fn__flex-1") as HTMLElement).style as CSSStyleDeclarationElectron).WebkitAppRegion = "";
|
||||
}
|
||||
});
|
||||
this.headElement.addEventListener("dragend", (event: DragEvent & { target: HTMLElement }) => {
|
||||
const tabElement = hasClosestByTag(event.target, "LI");
|
||||
|
|
@ -136,6 +139,9 @@ export class Tab {
|
|||
}
|
||||
});
|
||||
}
|
||||
if (isWindow() && this.headElement.getBoundingClientRect().top <= 0) {
|
||||
((this.headElement.parentElement.parentElement.querySelector(".item--readonly .fn__flex-1") as HTMLElement).style as CSSStyleDeclarationElectron).WebkitAppRegion = "drag";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -231,7 +231,6 @@ export class Wnd {
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
this.headersElement.parentElement.addEventListener("drop", function (event: DragEvent & {
|
||||
target: HTMLElement
|
||||
}) {
|
||||
|
|
|
|||
4
app/src/types/index.d.ts
vendored
4
app/src/types/index.d.ts
vendored
|
|
@ -124,6 +124,10 @@ declare namespace CSS {
|
|||
const highlights: Map<string, Highlight>;
|
||||
}
|
||||
|
||||
interface CSSStyleDeclarationElectron extends CSSStyleDeclaration {
|
||||
WebkitAppRegion: string
|
||||
}
|
||||
|
||||
interface Window {
|
||||
echarts: {
|
||||
init(element: HTMLElement, theme?: string, options?: {
|
||||
|
|
|
|||
|
|
@ -18,11 +18,9 @@ export const setTabPosition = () => {
|
|||
const dragElement = headerElement.querySelector(".item--readonly .fn__flex-1") as HTMLElement;
|
||||
if (rect.top <= 0) {
|
||||
dragElement.style.height = dragElement.parentElement.clientHeight + "px";
|
||||
// @ts-ignore
|
||||
dragElement.style.WebkitAppRegion = "drag";
|
||||
(dragElement.style as CSSStyleDeclarationElectron).WebkitAppRegion = "drag";
|
||||
} else {
|
||||
// @ts-ignore
|
||||
dragElement.style.WebkitAppRegion = "";
|
||||
(dragElement.style as CSSStyleDeclarationElectron).WebkitAppRegion = "";
|
||||
}
|
||||
const headersLastElement = headerElement.lastElementChild as HTMLElement;
|
||||
if ("darwin" === window.siyuan.config.system.os) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue