Add hiding order-sort pane when clicked off of.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Captain ALM 2022-07-30 17:59:14 +01:00
parent 2477a7ee20
commit 5bbd9db71d
Signed by: alfred
GPG Key ID: 4E4ADD02609997B1

View File

@ -3,8 +3,10 @@ This file is (C) Captain ALM
Under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License Under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License
*/ */
const EntryData = [] const EntryData = []
var SortOrderStateI = true
function SetupJS() { function SetupJS() {
SetupJSTheme() SetupJSTheme()
SetupJSHSO()
} }
function CreateEntry(id, name, videourl, videotype, start, end, duration) { function CreateEntry(id, name, videourl, videotype, start, end, duration) {
EntryData[id] = { EntryData[id] = {
@ -104,3 +106,27 @@ function ToggleTheme() {
thsty.href = CssLightURL thsty.href = CssLightURL
} }
} }
function SetupJSHSO() {
let pane = document.getElementById("so-pane")
if (document.addEventListener) {
document.addEventListener("click", HandleGlobalClick)
pane.addEventListener("mouseover", HandleSortOrderEnter)
pane.addEventListener("mouseout", HandleSortOrderLeave)
} else {
document.parentElement.setAttribute("onclick", "HandleGlobalClick();")
pane.setAttribute("onmouseover", "HandleSortOrderEnter();")
pane.setAttribute("onmouseout", "HandleSortOrderLeave();")
document.parentElement.onclick = HandleGlobalClick
pane.onmouseover = HandleSortOrderEnter
pane.onmouseout = HandleSortOrderLeave
}
}
function HandleGlobalClick() {
if (SortOrderStateI) {document.getElementById("sort-menu").checked = false;}
}
function HandleSortOrderEnter() {
SortOrderStateI = false
}
function HandleSortOrderLeave(){
SortOrderStateI = true
}