chef 3808 Posted August 14, 2017 Posted August 14, 2017 (edited) Yeah, I'm starting to get some feature requests for themes and I need to turn features on and off. So far I can create elements under the theme settings, but I can't get them to save. This under settings.js: view.addEventListener('viewbeforehide', function (e) { skinSettings.enableAntiSpoliers(view.querySelector('.chkEnableEpisodeAntiSpoliers').checked); skinSettings.enableFloatAnimation(view.querySelector('.chkEnableFloatAnimation').checked); skinSettings.apply(); }); function renderSettings() { focusManager.autoFocus(view); view.querySelector('.chkEnableEpisodeAntiSpoliers').checked = skinSettings.enableAntiSpoliers(); view.querySelector('.chkEnableFloatAnimation').checked = skinSettings.enableFloatAnimation(); } }; This in HTML: <div class="checkboxContainer checkboxContainer-withDescription"> <label> <input is="emby-checkbox" type="checkbox" class="chkEnableFloatAnimation" /> <span>Enable Float Animation</span> </label> <div class="fieldDescription checkboxFieldDescription">${EnableFloatAnimation}</div> This in home.js: cards[i].classList.add('card-focusscale'); cards[i].querySelector('.cardBox').classList.add('cardBox-focustransform'); if(!skinSettings.enableFloatAnimation()){ cards[i].classList.remove('float'); } But where are the settings being saved to please. Many thanks Edited August 14, 2017 by chef
chef 3808 Posted August 14, 2017 Author Posted August 14, 2017 (edited) Nowhere that you can easily get to. Lol! Okay... Wait! I get it, it is saved on the users settings on their computer. That makes sense. Can't have github link back to drives on users computers for just anybody. Edited August 14, 2017 by chef
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now