fix header width when maximizing initially small window

This commit is contained in:
tophf 2022-01-16 15:45:55 +03:00
parent 0c20ef5d17
commit 956b60e1ef

View File

@ -479,7 +479,9 @@ const dom = {};
HW,
HWprefId,
setHWProp(width) {
width = Math.round(Math.max(200, Math.min(innerWidth / 3, Number(width) || 0)));
// If this is a small window on a big monitor the user can maximize it later
const max = (innerWidth < 850 ? screen.availWidth : innerWidth) / 3;
width = Math.round(Math.max(200, Math.min(max, Number(width) || 0)));
elHtml.style.setProperty('--header-width', width + 'px');
return width;
},