Add to resize event.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Captain ALM 2022-08-17 21:44:52 +01:00
parent 606be703fa
commit efda456bcc
Signed by: alfred
GPG Key ID: 4E4ADD02609997B1

View File

@ -14,6 +14,7 @@ function SetupJS() {
SetupJSTheme() SetupJSTheme()
SetupJSHSO() SetupJSHSO()
SetupJSSOI() SetupJSSOI()
SetupJSRSN()
} }
function CreateEntry(id, name, videourl, videotype, start, end, duration) { function CreateEntry(id, name, videourl, videotype, start, end, duration) {
EntryData[id] = { EntryData[id] = {
@ -291,6 +292,15 @@ function SortDurationD(a, b) {
return 1 return 1
} }
} }
function SetupJSRSN() {
if (window.addEventListener) {
window.addEventListener("resize", PerformNavResize)
} else {
window.setAttribute("onresize", "PerformNavResize();")
window.onresize = PerformNavResize
}
PerformNavResize()
}
function PerformNavResize() { function PerformNavResize() {
var ht = document.getElementsByTagName("html") var ht = document.getElementsByTagName("html")
if (ht && ht.length > 0) { if (ht && ht.length > 0) {
@ -299,7 +309,7 @@ function PerformNavResize() {
var vmen = document.getElementById("vmenu") var vmen = document.getElementById("vmenu")
if (men && vmen) { if (men && vmen) {
if (ht[0].clientWidth > 679) { 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 { } else {
var vmeni var vmeni
var mensz = 0 var mensz = 0