Skip to content

Commit

Permalink
🐛 fix #10765
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Mar 27, 2024
1 parent 0322e02 commit ad574a3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
30 changes: 15 additions & 15 deletions app/src/protyle/breadcrumb/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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")) {
Expand Down
5 changes: 3 additions & 2 deletions app/src/window/setHeader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ export const setTabPosition = () => {
cmd: "isFullScreen",
});
if (rect.top <= 0 && rect.left <= 0 && !isFullScreen) {
item.headersElement.style.marginLeft = "var(--b3-toolbar-left-mac)";
// 用 marginLeft 左侧底部无线条
item.headersElement.style.paddingLeft = "var(--b3-toolbar-left-mac)";
headersLastElement.style.paddingRight = "42px";
} else {
item.headersElement.style.marginLeft = "";
item.headersElement.style.paddingLeft = "";
headersLastElement.style.paddingRight = "";
}
}
Expand Down

0 comments on commit ad574a3

Please sign in to comment.