Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions add-on/jplayer.playlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,20 @@
// Create live handlers for the playlist items
$(this.cssSelector.playlist).off("click", "a." + this.options.playlistOptions.itemClass).on("click", "a." + this.options.playlistOptions.itemClass, function() {
var index = $(this).parent().parent().index();
var playing = $(this).is('.jp-playlist-playing');

if(self.current !== index) {
self.play(index);
if ( playing ) {
self.pause();
} else {
self.play(index);
}
} else {
$(self.cssSelector.jPlayer).jPlayer("play");
if ( playing ) {
$(self.cssSelector.jPlayer).jPlayer("pause");
} else {
$(self.cssSelector.jPlayer).jPlayer("play");
}
}
$(this).blur();
return false;
Expand Down