Skip to content
Snippets Groups Projects
Commit 4825d24f authored by ale's avatar ale
Browse files

fix

parent 2925d24b
No related branches found
No related tags found
No related merge requests found
......@@ -37,6 +37,7 @@ djr.Backend.prototype.search = function(query, callback, ctx) {
djr.Backend.prototype.getPlaylist = function(uuid, callback, ctx) {
$.ajax({url: '/json/playlist/get/' + uuid,
dataType: 'json',
type: 'GET',
context: ctx,
success: function(data, status, jqxhr) {
callback(new djr.PlaylistChunk(data.songs));
......@@ -198,6 +199,9 @@ djr.Player.prototype.removeChunkCallback = function() {
// Search!
djr.Player.prototype.search = function(query) {
var player = this;
djr.debug('djr.player.search: query=' + query + ', this=' + this);
this.backend.search(query, function(results) {
var songs = [];
$.each(results, function(idx, item) {
......@@ -211,7 +215,6 @@ djr.Player.prototype.search = function(query) {
var chunk_id = this.playlist.addChunk(new djr.PlaylistChunk(songs));
djr.debug('search: new chunk ' + chunk_id);
var player = this;
this.backend.getHtmlForSongs(songs, function(songs_html) {
var chunk_div = 'chunk_' + chunk_id;
player.hideAllChunks();
......@@ -226,8 +229,8 @@ djr.Player.prototype.search = function(query) {
$('#' + chunk_div + ' .album_a').click(function() {
player.search('(album:\"' + $(this).text() + '\")');
});
}, this);
}, this);
}, player);
}, player);
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment