🚨
This commit is contained in:
parent
dc2691d6a9
commit
78ed38a33a
6 changed files with 13 additions and 15 deletions
|
@ -28,7 +28,7 @@ export const initStatus = (isWindow = false) => {
|
|||
<div class="b3-menu fn__none" style="bottom: 32px;left: 5px">
|
||||
${menuHTML}
|
||||
</div>
|
||||
</div>`
|
||||
</div>`;
|
||||
}
|
||||
document.getElementById("status").innerHTML = `${barDockHTML}
|
||||
<div class="status__msg"></div>
|
||||
|
|
|
@ -28,7 +28,6 @@ import {pdfResize} from "../asset/renderAssets";
|
|||
import {Backlink} from "./dock/Backlink";
|
||||
import {openFileById} from "../editor/util";
|
||||
import {getSearch, isWindow} from "../util/functions";
|
||||
import {setTabPosition} from "../window/setHeader";
|
||||
|
||||
export const setPanelFocus = (element: Element) => {
|
||||
if (element.classList.contains("layout__tab--active") || element.classList.contains("layout__wnd--active")) {
|
||||
|
|
|
@ -223,9 +223,9 @@ export const initTabMenu = (tab: Tab) => {
|
|||
webSecurity: false,
|
||||
},
|
||||
});
|
||||
const json = {}
|
||||
layoutToJSON(tab, json)
|
||||
win.loadURL(`${window.location.protocol}//${window.location.host}/stage/build/app/window.html?v=${Constants.SIYUAN_VERSION}&json=${JSON.stringify(json)}`)
|
||||
const json = {};
|
||||
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);
|
||||
}
|
||||
}).element);
|
||||
|
|
|
@ -518,7 +518,7 @@ export const initWindow = () => {
|
|||
</svg>
|
||||
</div>`;
|
||||
if (isWindow()) {
|
||||
document.body.insertAdjacentHTML("beforeend", `<div class="toolbar__window">${controlsHTML}</div>`)
|
||||
document.body.insertAdjacentHTML("beforeend", `<div class="toolbar__window">${controlsHTML}</div>`);
|
||||
} else {
|
||||
document.getElementById("windowControls").innerHTML = controlsHTML;
|
||||
}
|
||||
|
|
|
@ -8,7 +8,6 @@ import {appearance} from "../config/appearance";
|
|||
import {initAssets, setInlineStyle} from "../util/assets";
|
||||
import {renderSnippet} from "../config/util/snippets";
|
||||
import {getSearch} from "../util/functions";
|
||||
import {Layout} from "../layout";
|
||||
import {initWindow} from "../util/onGetConfig";
|
||||
|
||||
export const init = () => {
|
||||
|
@ -43,4 +42,4 @@ export const init = () => {
|
|||
resizeTabs();
|
||||
}, 200);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
|
@ -12,19 +12,19 @@ const getAllWnds = (layout: Layout, wnds: Wnd[]) => {
|
|||
getAllWnds(item, wnds);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
export const setTabPosition = () => {
|
||||
if (!isWindow()) {
|
||||
return;
|
||||
}
|
||||
const wndsTemp: Wnd[] = []
|
||||
const wndsTemp: Wnd[] = [];
|
||||
getAllWnds(window.siyuan.layout.layout, wndsTemp);
|
||||
wndsTemp.forEach(item => {
|
||||
const headerElement = item.headersElement.parentElement;
|
||||
const rect = headerElement.getBoundingClientRect()
|
||||
const dragElement = headerElement.querySelector('.item--readonly .fn__flex-1') as HTMLElement
|
||||
const rect = headerElement.getBoundingClientRect();
|
||||
const dragElement = headerElement.querySelector(".item--readonly .fn__flex-1") as HTMLElement;
|
||||
if (rect.top <= 0) {
|
||||
dragElement.style.height = dragElement.parentElement.clientHeight + "px"
|
||||
dragElement.style.height = dragElement.parentElement.clientHeight + "px";
|
||||
// @ts-ignore
|
||||
dragElement.style.WebkitAppRegion = "drag";
|
||||
} else {
|
||||
|
@ -44,5 +44,5 @@ export const setTabPosition = () => {
|
|||
(headerElement.lastElementChild as HTMLElement).style.paddingRight = "";
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue