diff --git a/static/hyperscript/functions._hs b/static/hyperscript/functions._hs index 8115b04..c77204b 100644 --- a/static/hyperscript/functions._hs +++ b/static/hyperscript/functions._hs @@ -132,90 +132,54 @@ end def toggleCVLength(isLong) set paper to the first .cv-paper - set lengthCheckbox to the first #lengthToggle - set menuLengthCheckbox to the first #lengthToggleMenu + set otherToggle to (#lengthToggle or #lengthToggleMenu) - -- Update DOM state if isLong is true remove .cv-short from paper add .cv-long to paper - if lengthCheckbox exists - set lengthCheckbox's checked to true - end - if menuLengthCheckbox exists - set menuLengthCheckbox's checked to true - end call localStorage.setItem('cv-length', 'long') + if otherToggle exists set otherToggle's checked to true end if isLong is false remove .cv-long from paper add .cv-short to paper - if lengthCheckbox exists - set lengthCheckbox's checked to false - end - if menuLengthCheckbox exists - set menuLengthCheckbox's checked to false - end call localStorage.setItem('cv-length', 'short') + if otherToggle exists set otherToggle's checked to false end end def toggleIcons(showIcons) set paper to the first .cv-paper - set iconsCheckbox to the first #iconToggle - set menuIconsCheckbox to the first #iconToggleMenu + set otherToggle to (#iconToggle or #iconToggleMenu) - -- Update DOM state if showIcons is true add .show-icons to paper - if iconsCheckbox exists - set iconsCheckbox's checked to true - end - if menuIconsCheckbox exists - set menuIconsCheckbox's checked to true - end - call localStorage.setItem('cv-icons', 'show') + call localStorage.setItem('cv-icons', 'true') + if otherToggle exists set otherToggle's checked to true end if showIcons is false remove .show-icons from paper - if iconsCheckbox exists - set iconsCheckbox's checked to false - end - if menuIconsCheckbox exists - set menuIconsCheckbox's checked to false - end - call localStorage.setItem('cv-icons', 'hide') + call localStorage.setItem('cv-icons', 'false') + if otherToggle exists set otherToggle's checked to false end end def toggleTheme(isClean) set container to the first .cv-container - set themeCheckbox to the first #themeToggle - set menuThemeCheckbox to the first #themeToggleMenu + set otherToggle to (#themeToggle or #themeToggleMenu) - -- Update DOM state if isClean is true add .theme-clean to container - if themeCheckbox exists - set themeCheckbox's checked to true - end - if menuThemeCheckbox exists - set menuThemeCheckbox's checked to true - end call localStorage.setItem('cv-theme', 'clean') + if otherToggle exists set otherToggle's checked to true end if isClean is false remove .theme-clean from container - if themeCheckbox exists - set themeCheckbox's checked to false - end - if menuThemeCheckbox exists - set menuThemeCheckbox's checked to false - end call localStorage.setItem('cv-theme', 'default') + if otherToggle exists set otherToggle's checked to false end end