mirror of
https://github.com/lencx/ChatGPT.git
synced 2024-10-01 01:06:13 -04:00
fix: ui adaptation for no titlebar
This commit is contained in:
parent
b0bb6e201e
commit
1e4c1de971
24
scripts/core.js
vendored
24
scripts/core.js
vendored
@ -94,10 +94,28 @@ function coreInit() {
|
||||
10,
|
||||
);
|
||||
const navStyleDom = document.createElement('style');
|
||||
navStyleDom.innerHTML = `nav{padding-top:${
|
||||
currentPaddingTop + topDom.clientHeight
|
||||
}px !important}`;
|
||||
navStyleDom.innerHTML = `nav{
|
||||
padding-top:${currentPaddingTop + topDom.clientHeight}px !important
|
||||
}
|
||||
button[aria-label="Show sidebar"]{
|
||||
margin-top:${topDom.clientHeight}px !important
|
||||
}
|
||||
`;
|
||||
document.head.appendChild(navStyleDom);
|
||||
} else {
|
||||
const navStyleDom = document.createElement('style');
|
||||
navStyleDom.innerHTML = `nav{
|
||||
padding-top:${topDom.clientHeight}px !important
|
||||
}
|
||||
button[aria-label="Show sidebar"]{
|
||||
margin-top:${topDom.clientHeight}px !important
|
||||
}
|
||||
`;
|
||||
document.head.appendChild(navStyleDom);
|
||||
const main = document.querySelector('main');
|
||||
if (main && main.parentElement.children.length > 1) {
|
||||
main.parentElement.children[0].style.paddingTop = topDom.clientHeight + 'px';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user