mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 18:10:12 +01:00
This commit is contained in:
parent
22a926946c
commit
09155c78e9
4 changed files with 47 additions and 19 deletions
|
|
@ -9,11 +9,12 @@ module.exports = {
|
||||||
'plugin:@typescript-eslint/recommended',
|
'plugin:@typescript-eslint/recommended',
|
||||||
],
|
],
|
||||||
rules: {
|
rules: {
|
||||||
semi:[2, "always"],
|
semi: [2, 'always'],
|
||||||
quotes:[2, "double", { "avoidEscape": true }],
|
quotes: [2, 'double', {'avoidEscape': true}],
|
||||||
'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',
|
||||||
|
|
|
||||||
|
|
@ -805,7 +805,7 @@ app.whenReady().then(() => {
|
||||||
})
|
})
|
||||||
|
|
||||||
ipcMain.on('siyuan-lock-screen', () => {
|
ipcMain.on('siyuan-lock-screen', () => {
|
||||||
workspaces.forEach(item => {
|
BrowserWindow.getAllWindows().forEach(item => {
|
||||||
item.browserWindow.webContents.send('siyuan-lock-screen')
|
item.browserWindow.webContents.send('siyuan-lock-screen')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -67,17 +67,23 @@ body {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.body--window.body--win32 .fullscreen {
|
&.body--window {
|
||||||
& > .protyle-breadcrumb,
|
.fullscreen {
|
||||||
& > .block__icons {
|
& > .protyle-breadcrumb,
|
||||||
padding-right: 126px;
|
& > .block__icons {
|
||||||
|
height: 42px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
&.body--window .fullscreen {
|
&.body--win32 .fullscreen {
|
||||||
& > .protyle-breadcrumb,
|
& > .protyle-breadcrumb,
|
||||||
& > .block__icons {
|
& > .block__icons {
|
||||||
height: 42px;
|
padding-right: 126px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.body--blur .layout-tab-bar {
|
||||||
|
background-color: var(--b3-toolbar-blur-background);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -146,7 +146,8 @@ export class Wnd {
|
||||||
it.style.opacity = ".1";
|
it.style.opacity = ".1";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!event.dataTransfer.types.includes(Constants.SIYUAN_DROP_TAB) || !window.siyuan.dragElement) {
|
// 不能使用 !window.siyuan.dragElement,因为移动页签到新窗口后,再把主窗口页签拖拽新窗口页签上时,该值为空
|
||||||
|
if (!event.dataTransfer.types.includes(Constants.SIYUAN_DROP_TAB)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
@ -160,10 +161,10 @@ export class Wnd {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (!newTabHeaderElement && !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) {
|
if (!exitDrag && oldTabHeaderElement) {
|
||||||
if (oldTabHeaderElement.classList.contains("item--pin")) {
|
if (oldTabHeaderElement.classList.contains("item--pin")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -171,6 +172,12 @@ export class Wnd {
|
||||||
oldTabHeaderElement.setAttribute("data-clone", "true");
|
oldTabHeaderElement.setAttribute("data-clone", "true");
|
||||||
it.append(oldTabHeaderElement);
|
it.append(oldTabHeaderElement);
|
||||||
return;
|
return;
|
||||||
|
} else if (!exitDrag && !oldTabHeaderElement) { // 拖拽到新窗口
|
||||||
|
oldTabHeaderElement = document.createElement("li")
|
||||||
|
oldTabHeaderElement.style.opacity = "0.1"
|
||||||
|
oldTabHeaderElement.innerHTML = '<svg class="svg"><use xlink:href="#iconFile"></use></svg>'
|
||||||
|
oldTabHeaderElement.setAttribute("data-clone", "true");
|
||||||
|
it.append(oldTabHeaderElement);
|
||||||
}
|
}
|
||||||
if (!newTabHeaderElement) {
|
if (!newTabHeaderElement) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -199,6 +206,7 @@ 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)) {
|
||||||
|
|
@ -216,7 +224,20 @@ export class Wnd {
|
||||||
it.style.opacity = "";
|
it.style.opacity = "";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const oldTab = getInstanceById(event.dataTransfer.getData(Constants.SIYUAN_DROP_TAB)) as Tab;
|
const tabId = event.dataTransfer.getData(Constants.SIYUAN_DROP_TAB)
|
||||||
|
let oldTab = getInstanceById(tabId) as Tab;
|
||||||
|
/// #if !BROWSER
|
||||||
|
if (!oldTab) { // 从主窗口拖拽到页签新窗口
|
||||||
|
JSONToCenter(JSON.parse(event.dataTransfer.getData(Constants.SIYUAN_DROP_TABTOWINDOW)), that);
|
||||||
|
oldTab = that.children[that.children.length - 1];
|
||||||
|
ipcRenderer.send(Constants.SIYUAN_CLOSETAB, tabId);
|
||||||
|
it.querySelector("li[data-clone='true']").remove();
|
||||||
|
that.switchTab(oldTab.headElement);
|
||||||
|
}
|
||||||
|
/// #endif
|
||||||
|
if (!oldTab) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
it.classList.remove("layout-tab-bar--drag");
|
it.classList.remove("layout-tab-bar--drag");
|
||||||
|
|
||||||
const nextTabHeaderElement = (Array.from(it.childNodes).find((item: HTMLElement) => {
|
const nextTabHeaderElement = (Array.from(it.childNodes).find((item: HTMLElement) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue