Skip to content
Browse files

Set keyboard cursor on right click.

Also, avoid errors by checking if audio is loaded at this point.
  • Loading branch information...
1 parent db63c1c commit 50cda2ec1ff5d22594e11a05acfcf3073ee81a11 @miracle2k committed May 21, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 app/js/lyrics.js
View
8 app/js/lyrics.js
@@ -334,6 +334,14 @@ LyricsBox.prototype.update = function() {
// On right click, start playing from that word's position.
elem.on('contextmenu', function(e) {
+ // Set the keyboard cursor here
+ self.setKeyboardCursorIndex(index);
+
+ // Bail out now if no audio is loaded
+ if (audio.readyState == audio.HAVE_NOTHING)
+ return true;
+
+ // Otherwise, go and set the play position
var goto = word.time;
if (goto == null) {
goto = lyrics.getApproximateTime(index);

0 comments on commit 50cda2e

Please sign in to comment.
Something went wrong with that request. Please try again.