mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2026-08-09 05:18:40 +02:00
Merge pull request #459 from benonymity/hapticFeedback
Add haptic feedback
This commit is contained in:
@@ -46,6 +46,7 @@
|
||||
|
||||
<script>
|
||||
import { Dialog } from '@capacitor/dialog'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
value: Boolean,
|
||||
@@ -94,6 +95,7 @@ export default {
|
||||
this.showBookmarkTitleInput = true
|
||||
},
|
||||
async deleteBookmark(bm) {
|
||||
await this.$hapticsImpactMedium()
|
||||
const { value } = await Dialog.confirm({
|
||||
title: 'Remove Bookmark',
|
||||
message: `Are you sure you want to remove bookmark?`
|
||||
@@ -111,7 +113,8 @@ export default {
|
||||
})
|
||||
this.show = false
|
||||
},
|
||||
clickBookmark(bm) {
|
||||
async clickBookmark(bm) {
|
||||
await this.$hapticsImpactMedium()
|
||||
this.$emit('select', bm)
|
||||
},
|
||||
submitUpdateBookmark(updatedBookmark) {
|
||||
@@ -155,7 +158,8 @@ export default {
|
||||
this.newBookmarkTitle = this.$formatDate(Date.now(), 'MMM dd, yyyy HH:mm')
|
||||
this.showBookmarkTitleInput = true
|
||||
},
|
||||
submitBookmark() {
|
||||
async submitBookmark() {
|
||||
await this.$hapticsImpactMedium()
|
||||
if (this.selectedBookmark) {
|
||||
var updatePayload = {
|
||||
...this.selectedBookmark,
|
||||
|
||||
@@ -212,7 +212,8 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clearSelected() {
|
||||
async clearSelected() {
|
||||
await this.$hapticsImpactMedium()
|
||||
this.selected = 'all'
|
||||
this.show = false
|
||||
this.$nextTick(() => this.$emit('change', 'all'))
|
||||
@@ -220,7 +221,7 @@ export default {
|
||||
clickedSublistOption(item) {
|
||||
this.clickedOption({ value: `${this.sublist}.${item}` })
|
||||
},
|
||||
clickedOption(option) {
|
||||
async clickedOption(option) {
|
||||
if (option.sublist) {
|
||||
this.sublist = option.value
|
||||
return
|
||||
@@ -231,6 +232,7 @@ export default {
|
||||
this.show = false
|
||||
return
|
||||
}
|
||||
await this.$hapticsImpactMedium()
|
||||
this.selected = val
|
||||
this.show = false
|
||||
this.$nextTick(() => this.$emit('change', val))
|
||||
@@ -244,4 +246,4 @@ export default {
|
||||
.filter-modal-wrapper {
|
||||
max-height: calc(100% - 320px);
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -49,6 +49,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
async clickedOption(lib) {
|
||||
await this.$hapticsImpactMedium()
|
||||
this.show = false
|
||||
if (lib.id === this.currentLibraryId) return
|
||||
await this.$store.dispatch('libraries/fetch', lib.id)
|
||||
|
||||
@@ -126,7 +126,8 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickedOption(val) {
|
||||
async clickedOption(val) {
|
||||
await this.$hapticsImpactMedium()
|
||||
if (this.selected === val) {
|
||||
this.selectedDesc = !this.selectedDesc
|
||||
} else {
|
||||
@@ -139,4 +140,4 @@ export default {
|
||||
},
|
||||
mounted() {}
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@@ -89,30 +89,37 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickedChapterOption() {
|
||||
async clickedChapterOption() {
|
||||
await this.$hapticsImpactMedium()
|
||||
this.show = false
|
||||
this.$nextTick(() => this.$emit('change', { time: this.currentEndOfChapterTime * 1000, isChapterTime: true }))
|
||||
},
|
||||
clickedOption(timeoutMin) {
|
||||
async clickedOption(timeoutMin) {
|
||||
await this.$hapticsImpactMedium()
|
||||
var timeout = timeoutMin * 1000 * 60
|
||||
this.show = false
|
||||
this.manualTimerModal = false
|
||||
this.$nextTick(() => this.$emit('change', { time: timeout, isChapterTime: false }))
|
||||
},
|
||||
cancelSleepTimer() {
|
||||
async cancelSleepTimer() {
|
||||
await this.$hapticsImpactMedium()
|
||||
this.$emit('cancel')
|
||||
this.show = false
|
||||
},
|
||||
increaseSleepTime() {
|
||||
async increaseSleepTime() {
|
||||
await this.$hapticsImpactMedium()
|
||||
this.$emit('increase')
|
||||
},
|
||||
decreaseSleepTime() {
|
||||
async decreaseSleepTime() {
|
||||
await this.$hapticsImpactMedium()
|
||||
this.$emit('decrease')
|
||||
},
|
||||
increaseManualTimeout() {
|
||||
async increaseManualTimeout() {
|
||||
await this.$hapticsImpactMedium()
|
||||
this.manualTimeoutMin++
|
||||
},
|
||||
decreaseManualTimeout() {
|
||||
async decreaseManualTimeout() {
|
||||
await this.$hapticsImpactMedium()
|
||||
if (this.manualTimeoutMin > 1) this.manualTimeoutMin--
|
||||
}
|
||||
},
|
||||
|
||||
@@ -114,7 +114,8 @@ export default {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
clickPlaylist(playlist) {
|
||||
async clickPlaylist(playlist) {
|
||||
await this.$hapticsImpactMedium()
|
||||
if (playlist.isItemIncluded) {
|
||||
this.removeFromPlaylist(playlist)
|
||||
} else {
|
||||
@@ -163,7 +164,8 @@ export default {
|
||||
this.newPlaylistName = ''
|
||||
this.showPlaylistNameInput = true
|
||||
},
|
||||
submitCreatePlaylist() {
|
||||
async submitCreatePlaylist() {
|
||||
await this.$hapticsImpactMedium()
|
||||
if (!this.newPlaylistName || !this.selectedPlaylistItems.length) {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user