Renamed expand switch settings function

This commit is contained in:
Georgy Litvinov 2021-03-03 15:01:08 +01:00
parent 875a639db5
commit dfaec1c1c4

View file

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