move walkThemes
This commit is contained in:
parent
639914ed33
commit
d43d477b75
26
index.js
26
index.js
|
@ -341,6 +341,19 @@ function toggleFilter (filter) {
|
|||
applyFilters()
|
||||
}
|
||||
|
||||
function walkThemes (direction) {
|
||||
const select = document.getElementById('select-theme')
|
||||
const current = select.selectedOptions[0]
|
||||
let next
|
||||
if (current) {
|
||||
next = direction === 'up' ? current.previousElementSibling : current.nextElementSibling
|
||||
}
|
||||
if (next) {
|
||||
select.value = next.value
|
||||
}
|
||||
selectTheme()
|
||||
}
|
||||
|
||||
window.onhashchange = () => {
|
||||
plausible('Font Selected')
|
||||
selectFont()
|
||||
|
@ -371,19 +384,6 @@ window.addEventListener('DOMContentLoaded', () => {
|
|||
setSpacing()
|
||||
selectLanguage()
|
||||
|
||||
function walkThemes (direction) {
|
||||
const select = document.getElementById('select-theme')
|
||||
const current = select.selectedOptions[0]
|
||||
let next
|
||||
if (current) {
|
||||
next = direction === 'up' ? current.previousElementSibling : current.nextElementSibling
|
||||
}
|
||||
if (next) {
|
||||
select.value = next.value
|
||||
}
|
||||
selectTheme()
|
||||
}
|
||||
|
||||
document.getElementById('theme-next').onclick = () => {
|
||||
walkThemes('down')
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue