diff options
author | Robin Appelman <icewind1991@gmail.com> | 2011-08-01 01:25:34 +0200 |
---|---|---|
committer | Robin Appelman <icewind1991@gmail.com> | 2011-08-01 01:25:34 +0200 |
commit | 9b764cb7f4f1438b80f03ae5e080231b8aaa9719 (patch) | |
tree | 3ece82499d70d7aa752c1042e77907992ad99f5e | |
parent | 28a64bc2f8d4f7573033fb2cba121866c0206086 (diff) | |
download | nextcloud-server-9b764cb7f4f1438b80f03ae5e080231b8aaa9719.tar.gz nextcloud-server-9b764cb7f4f1438b80f03ae5e080231b8aaa9719.zip |
show names of next/previous song when you hover the next/previous button
-rw-r--r-- | apps/media/js/player.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/apps/media/js/player.js b/apps/media/js/player.js index 5f48878563f..6dee7b0ac20 100644 --- a/apps/media/js/player.js +++ b/apps/media/js/player.js @@ -35,6 +35,18 @@ var PlayList={ PlayList.player.jPlayer("play"); localStorage.setItem('oc_playlist_current',index); localStorage.setItem('oc_playlist_playing','true'); + if(index>=0){ + var previous=index-1; + }else{ + var previous=PlayList.items.length-1; + } + if(index+1<PlayList.items.length){ + var next=index+1; + }else{ + var next=0; + } + $('.jp-next').attr('title',PlayList.items[next].name); + $('.jp-previous').attr('title',PlayList.items[previous].name); if (typeof Collection !== 'undefined') { Collection.registerPlay(); } |