[web] Simplify variable naming

This commit is contained in:
Alain Nussbaumer 2024-04-27 21:34:16 +02:00
parent 2d7776619f
commit 9319118190
2 changed files with 8 additions and 8 deletions

View File

@ -31,8 +31,8 @@ export const filters = {
.setLocale(locale.value) .setLocale(locale.value)
.toLocaleString(DateTime.DATETIME_MED) .toLocaleString(DateTime.DATETIME_MED)
}, },
durationInDays(value_ms) { durationInDays(value) {
const minutes = Math.floor(value_ms / 60000) const minutes = Math.floor(value / 60000)
if (minutes > 1440) { if (minutes > 1440) {
return Duration.fromObject({ minutes }) return Duration.fromObject({ minutes })
.shiftTo('days', 'hours', 'minutes') .shiftTo('days', 'hours', 'minutes')
@ -44,9 +44,9 @@ export const filters = {
} }
return Duration.fromObject({ minutes }).shiftTo('minutes').toHuman() return Duration.fromObject({ minutes }).shiftTo('minutes').toHuman()
}, },
durationInHours(value_ms) { durationInHours(value) {
const format = value_ms >= 3600000 ? 'h:mm:ss' : 'm:ss' const format = value >= 3600000 ? 'h:mm:ss' : 'm:ss'
return Duration.fromMillis(value_ms).toFormat(format) return Duration.fromMillis(value).toFormat(format)
}, },
number(value) { number(value) {
return value.toLocaleString(locale.value) return value.toLocaleString(locale.value)

View File

@ -4,7 +4,7 @@
<div class="columns is-centered"> <div class="columns is-centered">
<div class="column is-four-fifths"> <div class="column is-four-fifths">
<section v-if="$slots.options"> <section v-if="$slots.options">
<div ref="options_ref" style="height: 1px" /> <div ref="options" style="height: 1px" />
<slot name="options" /> <slot name="options" />
<nav class="buttons is-centered mt-4 mb-2"> <nav class="buttons is-centered mt-4 mb-2">
<router-link class="button is-small is-white" :to="position"> <router-link class="button is-small is-white" :to="position">
@ -65,12 +65,12 @@ export default {
rootMargin: '-82px 0px 0px 0px', rootMargin: '-82px 0px 0px 0px',
threshold: 1.0 threshold: 1.0
}) })
this.observer.observe(this.$refs.options_ref) this.observer.observe(this.$refs.options)
} }
}, },
methods: { methods: {
onElementObserved(entries) { onElementObserved(entries) {
entries.forEach(({ target, isIntersecting }) => { entries.forEach(({ isIntersecting }) => {
this.options_visible = isIntersecting this.options_visible = isIntersecting
}) })
}, },