Renamed expand switch settings function

This commit is contained in:
Georgy Litvinov 2021-03-03 15:01:08 +01:00
parent d3328ebf96
commit 5b77aaf75f

View file

@ -1,5 +1,5 @@
document.addEventListener('DOMContentLoaded', addCollapsibleOnClick(), false); document.addEventListener('DOMContentLoaded', addCollapsibleOnClick(), false);
document.addEventListener('DOMContentLoaded', expandAllCollapsedElements(), false); document.addEventListener('DOMContentLoaded', applyExpandSettings(), false);
function addCollapsibleOnClick() { function addCollapsibleOnClick() {
var coll = document.getElementsByClassName("collapsible"); var coll = document.getElementsByClassName("collapsible");
@ -16,7 +16,7 @@ function addCollapsibleOnClick() {
}); });
} }
} }
function expandAllCollapsedElements() { function applyExpandSettings() {
if (localStorage.getItem('switchExpand') === true || localStorage.getItem('switchExpand') === 'true') { if (localStorage.getItem('switchExpand') === true || localStorage.getItem('switchExpand') === 'true') {
var expandSwitchCB = document.getElementById("expandCB"); var expandSwitchCB = document.getElementById("expandCB");
if ( expandSwitchCB != null ){ if ( expandSwitchCB != null ){
@ -26,7 +26,6 @@ function expandAllCollapsedElements() {
if ( expandSwitchSettingsCB != null ){ if ( expandSwitchSettingsCB != null ){
expandSwitchSettingsCB.checked = true; expandSwitchSettingsCB.checked = true;
} }
$('.autoExpand').show(); $('.autoExpand').show();
} else { } else {
$('.autoExpand').hide(); $('.autoExpand').hide();