mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 10:00:13 +01:00
🚨
This commit is contained in:
parent
bd2b35320f
commit
8176ba40a8
4 changed files with 10 additions and 10 deletions
|
|
@ -81,8 +81,8 @@ export class Tab {
|
|||
if (tabElement) {
|
||||
event.dataTransfer.setData("text/html", tabElement.outerHTML);
|
||||
event.dataTransfer.setData(Constants.SIYUAN_DROP_TAB, this.id);
|
||||
const modeJSON = {}
|
||||
layoutToJSON(this, modeJSON)
|
||||
const modeJSON = {};
|
||||
layoutToJSON(this, modeJSON);
|
||||
event.dataTransfer.setData(Constants.SIYUAN_DROP_TABTOWINDOW, JSON.stringify(modeJSON));
|
||||
event.dataTransfer.dropEffect = "move";
|
||||
tabElement.style.opacity = "0.1";
|
||||
|
|
@ -103,10 +103,10 @@ export class Tab {
|
|||
if (!this.headElement.style.maxWidth) {
|
||||
const windowBounds = getCurrentWindow().getBounds();
|
||||
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
|
||||
window.siyuan.dragElement = undefined;
|
||||
if (event.dataTransfer.dropEffect === "none") {
|
||||
|
|
|
|||
|
|
@ -173,9 +173,9 @@ export class Wnd {
|
|||
it.append(oldTabHeaderElement);
|
||||
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 = 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);
|
||||
}
|
||||
|
|
@ -224,7 +224,7 @@ export class Wnd {
|
|||
it.style.opacity = "";
|
||||
return;
|
||||
}
|
||||
const tabId = event.dataTransfer.getData(Constants.SIYUAN_DROP_TAB)
|
||||
const tabId = event.dataTransfer.getData(Constants.SIYUAN_DROP_TAB);
|
||||
let oldTab = getInstanceById(tabId) as Tab;
|
||||
/// #if !BROWSER
|
||||
if (!oldTab) { // 从主窗口拖拽到页签新窗口
|
||||
|
|
|
|||
|
|
@ -903,7 +903,7 @@ ${unicode2Emoji(item.icon || Constants.SIYUAN_IMAGE_FILE, false, "b3-list-item__
|
|||
});
|
||||
let dockHtml = "";
|
||||
if (!isWindow()) {
|
||||
dockHtml = '<ul class="b3-list b3-list--background" style="max-height: calc(70vh - 35px)">'
|
||||
dockHtml = '<ul class="b3-list b3-list--background" style="max-height: calc(70vh - 35px)">';
|
||||
getAllDocks().forEach((item, index) => {
|
||||
dockHtml += `<li data-type="${item.type}" data-index="${index}" class="b3-list-item${(!tabHtml && !dockHtml) ? " b3-list-item--focus" : ""}">
|
||||
<svg class="b3-list-item__graphic"><use xlink:href="#${item.icon}"></use></svg>
|
||||
|
|
|
|||
|
|
@ -26,4 +26,4 @@ export const openNewWindow = (tab: Tab) => {
|
|||
layoutToJSON(tab, json);
|
||||
win.loadURL(`${window.location.protocol}//${window.location.host}/stage/build/app/window.html?v=${Constants.SIYUAN_VERSION}&json=${JSON.stringify(json)}`);
|
||||
tab.parent.removeTab(tab.id);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue