From c35e9621c9fa77c66affbbe5c4df37d1db8e2098 Mon Sep 17 00:00:00 2001 From: Mister Rajoy Date: Wed, 2 Dec 2020 14:17:34 +0100 Subject: [PATCH] Fix selected option recognition --- .../Configuration/configurationpage.html | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/Jellyfin.Plugin.SkinManager/Configuration/configurationpage.html b/Jellyfin.Plugin.SkinManager/Configuration/configurationpage.html index 0060fbf..3cc9429 100644 --- a/Jellyfin.Plugin.SkinManager/Configuration/configurationpage.html +++ b/Jellyfin.Plugin.SkinManager/Configuration/configurationpage.html @@ -54,6 +54,7 @@ cssOptions.appendChild(opt); }); updateSelectors() + } function loadOptions(options){ var page = $.mobile.activePage; @@ -117,7 +118,8 @@ var description = option.description; //html += '
'; html += '
' - return html + return html; + } function getOptions(option){ var html = ""; var selections = option.selections @@ -139,15 +141,7 @@ html += '
'+description+'
' return html } - function updateDescription( ){ - var description = document.getElementById("description"); - var selected = $('#cssOptions').val(); - data.forEach(element => { - if(element.defaultCss == selected){ - description.innerHTML=element.description; - } - }) - } + function createCss(){ var savedHtml = ""; //process checkbox @@ -198,11 +192,13 @@ return css; } function updateSelectors(){ - var selected = $('#cssOptions').val(); + var selected = document.getElementById("cssOptions"); + var description = document.getElementById("description"); data.forEach(element=>{ - if(element.defaultCss == selected){ + if(element.name == selected.selectedOptions[0].innerText){ loadOptions(element.options); - updateDescription(); + description.innerHTML=element.description; + } }) }