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()
|
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 = () => {
|
window.onhashchange = () => {
|
||||||
plausible('Font Selected')
|
plausible('Font Selected')
|
||||||
selectFont()
|
selectFont()
|
||||||
|
@ -371,19 +384,6 @@ window.addEventListener('DOMContentLoaded', () => {
|
||||||
setSpacing()
|
setSpacing()
|
||||||
selectLanguage()
|
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 = () => {
|
document.getElementById('theme-next').onclick = () => {
|
||||||
walkThemes('down')
|
walkThemes('down')
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue