From efda456bcc6b0b01719d2cf5fe93212b68d42eec Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Wed, 17 Aug 2022 21:44:52 +0100 Subject: [PATCH] Add to resize event. --- index.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index ed6e068..c84da25 100644 --- a/index.js +++ b/index.js @@ -14,6 +14,7 @@ function SetupJS() { SetupJSTheme() SetupJSHSO() SetupJSSOI() + SetupJSRSN() } function CreateEntry(id, name, videourl, videotype, start, end, duration) { EntryData[id] = { @@ -291,6 +292,15 @@ function SortDurationD(a, b) { return 1 } } +function SetupJSRSN() { + if (window.addEventListener) { + window.addEventListener("resize", PerformNavResize) + } else { + window.setAttribute("onresize", "PerformNavResize();") + window.onresize = PerformNavResize + } + PerformNavResize() +} function PerformNavResize() { var ht = document.getElementsByTagName("html") if (ht && ht.length > 0) { @@ -299,7 +309,7 @@ function PerformNavResize() { var vmen = document.getElementById("vmenu") if (men && vmen) { if (ht[0].clientWidth > 679) { - while (vmen.childNodes.length > 0) {InsertBefore(men, vmen.removeChild(vmen.childNodes[0]));} + while (vmen.childNodes.length > 0) {InsertBefore(men, vmen.removeChild(vmen.childNodes[vmen.childNodes.length - 1]));} } else { var vmeni var mensz = 0