From 956b60e1efe641439b9460718048368d8b0bc66f Mon Sep 17 00:00:00 2001 From: tophf Date: Sun, 16 Jan 2022 15:45:55 +0300 Subject: [PATCH] fix header width when maximizing initially small window --- js/dom.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/dom.js b/js/dom.js index 612acf71..5cb50aeb 100644 --- a/js/dom.js +++ b/js/dom.js @@ -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; },