Skip to content

Commit

Permalink
scrolling to top on song change #4
Browse files Browse the repository at this point in the history
  • Loading branch information
emilioastarita committed Oct 12, 2016
1 parent d9477cc commit feed1db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion render/SongRender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ export class SongRender {
this.searcher.syncLyrics((error, song, changed) => {
if (!error && changed) {
this.song = song;
this['$nextTick'](() => {
document.getElementById("lyricBox").scrollTop = 0;
})
}

this.scheduleNextCall();
});
}
Expand Down
2 changes: 1 addition & 1 deletion render/views/Song.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<h3>{{ song.title }}</h3>
<h4>{{ song.artist }}</h4>
</header>
<div class="lyrics">{{ song.lyric }}</div>
<div id="lyricBox" class="lyrics">{{ song.lyric }}</div>
</div>

<div v-else class="not-playing-view">
Expand Down

0 comments on commit feed1db

Please sign in to comment.