mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-12 20:31:36 +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: {
|
||||
clickSeek() {
|
||||
const time = this.cue.startTime;
|
||||
this.$emit('seek', time);
|
||||
const time = this.cue.startTime
|
||||
this.$emit('seek', time)
|
||||
},
|
||||
scrollIntoView() {
|
||||
this.$el.scrollIntoView({behavior: 'smooth'})
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (this.isActive) {
|
||||
this.scrollIntoView()
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.cue.onenter = () => (this.isActive = true);
|
||||
this.cue.onexit = () => (this.isActive = false);
|
||||
this.cue.onenter = () => (this.isActive = true)
|
||||
this.cue.onexit = () => (this.isActive = false)
|
||||
},
|
||||
watch: {
|
||||
isActive(newVal) {
|
||||
if (newVal) {
|
||||
this.$el.scrollIntoView({behavior: 'smooth'});
|
||||
this.scrollIntoView()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue