From 3c9451561e1a509812a8a06087c14b4d533bcb8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Rynning-T=C3=B8nnesen?= Date: Sat, 9 May 2015 21:57:53 +0200 Subject: [PATCH] Fixed songs in search --- static/js/search.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/static/js/search.js b/static/js/search.js index 7f04b92f..31499edd 100755 --- a/static/js/search.js +++ b/static/js/search.js @@ -198,12 +198,13 @@ function search(search_input){ //$("#results").append(result_html); var song = pre_result; + song.find(".search-title").text(title); song.find(".result_info").text(duration); song.find(".thumb").attr("src", thumb); song.find(".add-many").attr("onclick", "submit('"+id+"','"+enc_title+"',"+secs+");"); - song.attr("onclick", "submitAndClose('"+id+"','"+enc_title+"',"+secs+");"); - song.attr("id",id); + $($(song).find("div")[0]).attr("onclick", "submitAndClose('"+id+"','"+enc_title+"',"+secs+");"); + $($(song).find("div")[0]).attr("id", id) output += song.html();