aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorRobin Appelman <icewind1991@gmail.com>2011-07-31 01:39:25 +0200
committerRobin Appelman <icewind1991@gmail.com>2011-07-31 01:39:25 +0200
commit3a08f747fb714731ec1323fc59d3cb7c4784db5e (patch)
tree949fe88b6f00846ad6818aea7254512d897b7549 /apps
parent1564a40538a698f8f83f8482da650baf050b27d6 (diff)
downloadnextcloud-server-3a08f747fb714731ec1323fc59d3cb7c4784db5e.tar.gz
nextcloud-server-3a08f747fb714731ec1323fc59d3cb7c4784db5e.zip
more tweaks for media search results
Diffstat (limited to 'apps')
-rw-r--r--apps/media/js/music.js35
1 files changed, 16 insertions, 19 deletions
diff --git a/apps/media/js/music.js b/apps/media/js/music.js
index 6c8c5644310..5b77194ebc4 100644
--- a/apps/media/js/music.js
+++ b/apps/media/js/music.js
@@ -24,25 +24,22 @@ $(document).ready(function(){
data[itemParts[0]]=decodeURIComponent(itemParts[1]).replace(/\+/g,' ');
}
var media=Collection.find(data.artist,data.album,data.song);
- if(!PlayList.playing()){
- var button=$('<input type="button" class="play"></input>');
- button.css('background-image','url('+OC.imagePath('core','actions/play')+')')
- button.click(function(){
- var oldSize=PlayList.items.length;
- PlayList.add(media);
- PlayList.play(oldSize);
- PlayList.render();
- });
- row.find('div.name').append(button);
- }else{
- var button=$('<input type="button" class="add"></input>');
- button.css('background-image','url('+OC.imagePath('core','actions/play-add')+')')
- button.click(function(){
- PlayList.add(media);
- PlayList.render();
- });
- row.find('div.name').append(button);
- }
+ var a=row.find('a');
+ a.attr('href','#');
+ a.click(function(){
+ var oldSize=PlayList.items.length;
+ PlayList.add(media);
+ PlayList.play(oldSize);
+ PlayList.render();
+ });
+ var button=$('<input type="button" title="Add to playlist" class="add"></input>');
+ button.css('background-image','url('+OC.imagePath('core','actions/play-add')+')')
+ button.click(function(event){
+ event.stopPropagation();
+ PlayList.add(media);
+ PlayList.render();
+ });
+ row.find('div.name').append(button);
}
});