mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-10 06:32:33 +01:00
This commit is contained in:
parent
0322e022f1
commit
ad574a3cde
2 changed files with 18 additions and 17 deletions
|
|
@ -46,7 +46,21 @@ export const fullscreen = (element: Element, btnElement?: Element) => {
|
|||
element.classList.add("fullscreen");
|
||||
document.getElementById("drag")?.classList.add("fn__hidden");
|
||||
}
|
||||
|
||||
if (isWindow()) {
|
||||
// 编辑器全屏
|
||||
/// #if !MOBILE
|
||||
const wndsTemp: Wnd[] = [];
|
||||
getAllWnds(window.siyuan.layout.layout, wndsTemp);
|
||||
wndsTemp.find(async item => {
|
||||
const headerElement = item.headersElement.parentElement;
|
||||
if (headerElement.getBoundingClientRect().top <= 0) {
|
||||
// @ts-ignore
|
||||
(headerElement.querySelector(".item--readonly .fn__flex-1") as HTMLElement).style.WebkitAppRegion = isFullscreen ? "drag" : "";
|
||||
return true;
|
||||
}
|
||||
});
|
||||
/// #endif
|
||||
}
|
||||
if (btnElement) {
|
||||
if (isFullscreen) {
|
||||
btnElement.querySelector("use").setAttribute("xlink:href", "#iconFullscreen");
|
||||
|
|
@ -64,20 +78,6 @@ export const fullscreen = (element: Element, btnElement?: Element) => {
|
|||
}
|
||||
}
|
||||
return;
|
||||
} else if (isWindow()) {
|
||||
// 编辑器全屏
|
||||
/// #if !MOBILE
|
||||
const wndsTemp: Wnd[] = [];
|
||||
getAllWnds(window.siyuan.layout.layout, wndsTemp);
|
||||
wndsTemp.find(async item => {
|
||||
const headerElement = item.headersElement.parentElement;
|
||||
if (headerElement.getBoundingClientRect().top <= 0) {
|
||||
// @ts-ignore
|
||||
(headerElement.querySelector(".item--readonly .fn__flex-1") as HTMLElement).style.WebkitAppRegion = isFullscreen ? "drag" : "";
|
||||
return;
|
||||
}
|
||||
});
|
||||
/// #endif
|
||||
}
|
||||
/// #if !MOBILE
|
||||
if (element.classList.contains("protyle")) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue