mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-14 13:21:39 +00:00
Automatically scrolls to active cue when enable/disable the transcription panel
This commit is contained in:
parent
ee8e7cf958
commit
282203a30a
1 changed files with 13 additions and 5 deletions
|
|
@ -16,18 +16,26 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
clickSeek() {
|
clickSeek() {
|
||||||
const time = this.cue.startTime;
|
const time = this.cue.startTime
|
||||||
this.$emit('seek', time);
|
this.$emit('seek', time)
|
||||||
|
},
|
||||||
|
scrollIntoView() {
|
||||||
|
this.$el.scrollIntoView({behavior: 'smooth'})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
if (this.isActive) {
|
||||||
|
this.scrollIntoView()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.cue.onenter = () => (this.isActive = true);
|
this.cue.onenter = () => (this.isActive = true)
|
||||||
this.cue.onexit = () => (this.isActive = false);
|
this.cue.onexit = () => (this.isActive = false)
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
isActive(newVal) {
|
isActive(newVal) {
|
||||||
if (newVal) {
|
if (newVal) {
|
||||||
this.$el.scrollIntoView({behavior: 'smooth'});
|
this.scrollIntoView()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue