mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-18 06:07:48 +00:00
fix: prevent lyric selection from seeking
This commit is contained in:
parent
39c56af8c1
commit
b489c847fd
1 changed files with 7 additions and 2 deletions
|
|
@ -134,7 +134,7 @@
|
||||||
v-for="(line, index) in lyricWithTranslation"
|
v-for="(line, index) in lyricWithTranslation"
|
||||||
:key="index"
|
:key="index"
|
||||||
:id="`line${index}`"
|
:id="`line${index}`"
|
||||||
@click="seek(line.time)"
|
@click="clickLyricLine(line.time)"
|
||||||
><span v-html="formatLine(line)"></span
|
><span v-html="formatLine(line)"></span
|
||||||
></div>
|
></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -275,10 +275,15 @@ export default {
|
||||||
this.$parent.$refs.player.setProgress(value);
|
this.$parent.$refs.player.setProgress(value);
|
||||||
this.$parent.$refs.player.player.seek(value);
|
this.$parent.$refs.player.player.seek(value);
|
||||||
},
|
},
|
||||||
|
clickLyricLine(value) {
|
||||||
|
if (window.getSelection().toString().length === 0) {
|
||||||
|
this.seek(value);
|
||||||
|
}
|
||||||
|
},
|
||||||
blurEffect(ev) {
|
blurEffect(ev) {
|
||||||
for (let i = 0; i < ev.target.children.length; i++) {
|
for (let i = 0; i < ev.target.children.length; i++) {
|
||||||
const el = ev.target.children[i];
|
const el = ev.target.children[i];
|
||||||
|
|
||||||
const distanceToCenterPercentage =
|
const distanceToCenterPercentage =
|
||||||
Math.abs(
|
Math.abs(
|
||||||
el.getBoundingClientRect().y +
|
el.getBoundingClientRect().y +
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue