mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 17:20:30 +08:00
web: fixed window maximization behaviour without organize_hook
This commit is contained in:
parent
193eaa48c8
commit
bd9f5bf9ee
@ -564,7 +564,8 @@ function __WindowManager() {
|
|||||||
let ah = el_win.__aspect_ratio_height;
|
let ah = el_win.__aspect_ratio_height;
|
||||||
let gw = view.right - view.left;
|
let gw = view.right - view.left;
|
||||||
let gh = view.bottom - view.top;
|
let gh = view.bottom - view.top;
|
||||||
if (aw && ah) {
|
if (el_win.organize_hook && aw && ah) {
|
||||||
|
// Умная машинерия только для aspect-ratio
|
||||||
if (aw / gw < ah / gh) {
|
if (aw / gw < ah / gh) {
|
||||||
el_win.style.width = "";
|
el_win.style.width = "";
|
||||||
el_win.style.height = gh + "px";
|
el_win.style.height = gh + "px";
|
||||||
@ -573,10 +574,10 @@ function __WindowManager() {
|
|||||||
el_win.style.height = "";
|
el_win.style.height = "";
|
||||||
el_win.style.width = gw + "px";
|
el_win.style.width = gw + "px";
|
||||||
}
|
}
|
||||||
}/* else {
|
} else {
|
||||||
el_win.style.width = gw + "px";
|
el_win.style.width = gw + "px";
|
||||||
el_win.style.height = gh + "px";
|
el_win.style.height = gh + "px";
|
||||||
}*/
|
}
|
||||||
|
|
||||||
let rect = el_win.getBoundingClientRect();
|
let rect = el_win.getBoundingClientRect();
|
||||||
el_win.style.left = Math.round((view.right - rect.width) / 2) + "px";
|
el_win.style.left = Math.round((view.right - rect.width) / 2) + "px";
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user