Finish implementation of custom disable buttons
This commit is contained in:
parent
e573e429c5
commit
73b4ce5f66
1 changed files with 11 additions and 1 deletions
|
@ -95,7 +95,15 @@ function setUnit(unit: string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function disableCustom() {
|
function disableCustom() {
|
||||||
showEnable(false, false)
|
const durationString = (document.getElementById('disable-duration') as HTMLInputElement).value
|
||||||
|
const unitInput = document.getElementById('unit') as HTMLInputElement
|
||||||
|
let modifier = 0
|
||||||
|
if (unitInput.value === 'minutes') {
|
||||||
|
modifier = 1
|
||||||
|
} else if (unitInput.value === 'hours') {
|
||||||
|
modifier = 2
|
||||||
|
}
|
||||||
|
disable(Math.pow(60, modifier) * Number.parseInt(durationString))
|
||||||
}
|
}
|
||||||
|
|
||||||
function animateLogo(animate: boolean) {
|
function animateLogo(animate: boolean) {
|
||||||
|
@ -128,6 +136,8 @@ function showEnable(show: boolean, showCustom?: boolean) {
|
||||||
disableCustom.classList.add('visible')
|
disableCustom.classList.add('visible')
|
||||||
disableCustom.classList.remove('hidden')
|
disableCustom.classList.remove('hidden')
|
||||||
}, 250)
|
}, 250)
|
||||||
|
} else {
|
||||||
|
disableCustom.classList.replace('visible', 'hidden')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue