From 5f4fe169c81a1ba03d55e3e404ed58d8dcca4c80 Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Wed, 17 Aug 2022 21:55:09 +0100 Subject: [PATCH] Fix nav resizing. --- index.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index c84da25..b1d161d 100644 --- a/index.js +++ b/index.js @@ -302,13 +302,19 @@ function SetupJSRSN() { PerformNavResize() } function PerformNavResize() { - var ht = document.getElementsByTagName("html") - if (ht && ht.length > 0) { - var maxbarsz = ht[0].clientWidth - 324; + var ww = 0 + if (window.innerWidth && window.innerWidth !== 10) { + ww = window.innerWidth + } else { + var ht = document.getElementsByTagName("html") + if (ht && ht.length > 0) {ww = ht[0].clientWidth;} + } + if (ww > 0) { + var maxbarsz = ww - 324; var men = document.getElementById("menu") var vmen = document.getElementById("vmenu") if (men && vmen) { - if (ht[0].clientWidth > 679) { + if (ww > 679) { while (vmen.childNodes.length > 0) {InsertBefore(men, vmen.removeChild(vmen.childNodes[vmen.childNodes.length - 1]));} } else { var vmeni