mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 10:00:13 +01:00
This commit is contained in:
parent
ea5f43183c
commit
6bbb679cd2
4 changed files with 13 additions and 15 deletions
|
|
@ -14,7 +14,6 @@ module.exports = {
|
||||||
'no-prototype-builtins': 'off',
|
'no-prototype-builtins': 'off',
|
||||||
'no-useless-escape': 'off',
|
'no-useless-escape': 'off',
|
||||||
'no-irregular-whitespace': 'off',
|
'no-irregular-whitespace': 'off',
|
||||||
'@typescript-eslint/no-this-alia': 'off',
|
|
||||||
'@typescript-eslint/ban-ts-comment': 'off',
|
'@typescript-eslint/ban-ts-comment': 'off',
|
||||||
'@typescript-eslint/no-var-requires': 'off',
|
'@typescript-eslint/no-var-requires': 'off',
|
||||||
'@typescript-eslint/explicit-function-return-type': 'off',
|
'@typescript-eslint/explicit-function-return-type': 'off',
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ body {
|
||||||
}
|
}
|
||||||
|
|
||||||
&.body--blur .layout-tab-bar {
|
&.body--blur .layout-tab-bar {
|
||||||
background-color: var(--b3-toolbar-blur-background);
|
opacity: .38;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@ import {fetchPost} from "../util/fetch";
|
||||||
import {showTooltip} from "../dialog/tooltip";
|
import {showTooltip} from "../dialog/tooltip";
|
||||||
import {isTouchDevice} from "../util/functions";
|
import {isTouchDevice} from "../util/functions";
|
||||||
/// #if !BROWSER
|
/// #if !BROWSER
|
||||||
import {getCurrentWindow} from "@electron/remote";
|
|
||||||
import {openNewWindow} from "../window/openNewWindow";
|
import {openNewWindow} from "../window/openNewWindow";
|
||||||
/// #endif
|
/// #endif
|
||||||
import {layoutToJSON} from "./util";
|
import {layoutToJSON} from "./util";
|
||||||
|
|
@ -100,11 +99,9 @@ export class Tab {
|
||||||
/// #if !BROWSER
|
/// #if !BROWSER
|
||||||
// 拖拽到屏幕外
|
// 拖拽到屏幕外
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (!this.headElement.style.maxWidth) {
|
if (document.body.contains(this.panelElement) &&
|
||||||
const windowBounds = getCurrentWindow().getBounds();
|
(event.clientX < 0 || event.clientY < 0 || event.clientX > window.innerWidth || event.clientY > window.innerHeight)) {
|
||||||
if (event.clientX < 0 || event.clientY < 0 || event.clientX > windowBounds.width || event.clientY > windowBounds.height) {
|
openNewWindow(this);
|
||||||
openNewWindow(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}, Constants.TIMEOUT_BLOCKLOAD); // 等待主进程发送关闭消息
|
}, Constants.TIMEOUT_BLOCKLOAD); // 等待主进程发送关闭消息
|
||||||
/// #endif
|
/// #endif
|
||||||
|
|
|
||||||
|
|
@ -161,7 +161,7 @@ export class Wnd {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (!newTabHeaderElement && oldTabHeaderElement && !oldTabHeaderElement.classList.contains("item--pin")) {
|
if (!newTabHeaderElement && oldTabHeaderElement && !oldTabHeaderElement.classList.contains("item--pin")) {
|
||||||
it.classList.add("layout-tab-bar--drag");
|
it.classList.add("layout-tab-bar--drag");
|
||||||
}
|
}
|
||||||
if (!exitDrag && oldTabHeaderElement) {
|
if (!exitDrag && oldTabHeaderElement) {
|
||||||
|
|
@ -206,7 +206,6 @@ export class Wnd {
|
||||||
});
|
});
|
||||||
it.style.opacity = "";
|
it.style.opacity = "";
|
||||||
});
|
});
|
||||||
const that = this;
|
|
||||||
this.headersElement.addEventListener("drop", function (event: DragEvent & { target: HTMLElement }) {
|
this.headersElement.addEventListener("drop", function (event: DragEvent & { target: HTMLElement }) {
|
||||||
const it = this as HTMLElement;
|
const it = this as HTMLElement;
|
||||||
if (event.dataTransfer.types.includes(Constants.SIYUAN_DROP_FILE)) {
|
if (event.dataTransfer.types.includes(Constants.SIYUAN_DROP_FILE)) {
|
||||||
|
|
@ -228,11 +227,14 @@ export class Wnd {
|
||||||
let oldTab = getInstanceById(tabId) as Tab;
|
let oldTab = getInstanceById(tabId) as Tab;
|
||||||
/// #if !BROWSER
|
/// #if !BROWSER
|
||||||
if (!oldTab) { // 从主窗口拖拽到页签新窗口
|
if (!oldTab) { // 从主窗口拖拽到页签新窗口
|
||||||
JSONToCenter(JSON.parse(event.dataTransfer.getData(Constants.SIYUAN_DROP_TABTOWINDOW)), that);
|
const wnd = getInstanceById(this.parentElement.parentElement.getAttribute("data-id"));
|
||||||
oldTab = that.children[that.children.length - 1];
|
if (wnd instanceof Wnd) {
|
||||||
ipcRenderer.send(Constants.SIYUAN_CLOSETAB, tabId);
|
JSONToCenter(JSON.parse(event.dataTransfer.getData(Constants.SIYUAN_DROP_TABTOWINDOW)), wnd);
|
||||||
it.querySelector("li[data-clone='true']").remove();
|
oldTab = wnd.children[wnd.children.length - 1];
|
||||||
that.switchTab(oldTab.headElement);
|
ipcRenderer.send(Constants.SIYUAN_CLOSETAB, tabId);
|
||||||
|
it.querySelector("li[data-clone='true']").remove();
|
||||||
|
wnd.switchTab(oldTab.headElement);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/// #endif
|
/// #endif
|
||||||
if (!oldTab) {
|
if (!oldTab) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue