[web] Lint too short variable names

This commit is contained in:
Alain Nussbaumer 2024-04-26 18:24:34 +02:00
parent 8fe6cba6ef
commit d246c42a99
4 changed files with 14 additions and 16 deletions

View File

@ -175,13 +175,11 @@ export default {
pane.scrollTop pane.scrollTop
}) })
}, },
start_scrolling(e) { start_scrolling(event) {
// Consider only user events // Consider only user events
if (e.screenX || e.screenX !== 0 || e.screenY || e.screenY !== 0) { if (event.screenX ?? event.screenY) {
this.autoScrolling = false this.autoScrolling = false
if (this.scrollingTimer) {
clearTimeout(this.scrollingTimer) clearTimeout(this.scrollingTimer)
}
// Reenable automatic scrolling after 2 seconds // Reenable automatic scrolling after 2 seconds
this.scrollingTimer = setTimeout((this.autoScrolling = true), 2000) this.scrollingTimer = setTimeout((this.autoScrolling = true), 2000)
} }

View File

@ -29,10 +29,10 @@ export default {
this.context = new (window.AudioContext || window.webkitAudioContext)() this.context = new (window.AudioContext || window.webkitAudioContext)()
const source = this.context.createMediaElementSource(this.audio) const source = this.context.createMediaElementSource(this.audio)
source.connect(this.context.destination) source.connect(this.context.destination)
this.audio.addEventListener('canplaythrough', (e) => { this.audio.addEventListener('canplaythrough', (event) => {
this.audio.play() this.audio.play()
}) })
this.audio.addEventListener('canplay', (e) => { this.audio.addEventListener('canplay', (event) => {
this.audio.play() this.audio.play()
}) })
return this.audio return this.audio
@ -42,17 +42,17 @@ export default {
stop() { stop() {
try { try {
this.audio.pause() this.audio.pause()
} catch (e) { } catch (error) {
// Continue regardless of error // Continue regardless of error
} }
try { try {
this.audio.stop() this.audio.stop()
} catch (e) { } catch (error) {
// Continue regardless of error // Continue regardless of error
} }
try { try {
this.audio.close() this.audio.close()
} catch (e) { } catch (error) {
// Continue regardless of error // Continue regardless of error
} }
} }

View File

@ -163,11 +163,11 @@ export default {
}, },
methods: { methods: {
move_item(e) { move_item(event) {
const oldPosition = const oldPosition =
e.oldIndex + (this.show_only_next_items && this.current_position) event.oldIndex + (this.show_only_next_items && this.current_position)
const item = this.queue_items[oldPosition] const item = this.queue_items[oldPosition]
const newPosition = item.position + (e.newIndex - e.oldIndex) const newPosition = item.position + (event.newIndex - event.oldIndex)
if (newPosition !== oldPosition) { if (newPosition !== oldPosition) {
webapi.queue_move(item.id, newPosition) webapi.queue_move(item.id, newPosition)
} }

View File

@ -70,7 +70,7 @@ export default createStore({
getters: { getters: {
now_playing: (state) => now_playing: (state) =>
state.queue.items.find((e) => e.id === state.player.item_id) ?? {}, state.queue.items.find((item) => item.id === state.player.item_id) ?? {},
setting: (state) => (categoryName, optionName) => setting: (state) => (categoryName, optionName) =>
state.settings.categories state.settings.categories
.find((category) => category.name === categoryName) .find((category) => category.name === categoryName)
@ -227,10 +227,10 @@ export default createStore({
}, },
update_setting({ state }, option) { update_setting({ state }, option) {
const settingCategory = state.settings.categories.find( const settingCategory = state.settings.categories.find(
(e) => e.name === option.category (category) => category.name === option.category
), ),
settingOption = settingCategory.options.find( settingOption = settingCategory.options.find(
(e) => e.name === option.name (setting) => setting.name === option.name
) )
settingOption.value = option.value settingOption.value = option.value
} }