mirror of https://github.com/calzoneman/sync.git
Fix search result buttons issue
This commit is contained in:
parent
0addff6bab
commit
b3f4fc2b52
|
@ -1,3 +1,7 @@
|
||||||
|
Tue Sep 24 13:15 2013 CDT
|
||||||
|
* www/assets/js/callbacks.js: Instantiate a new paginator for every
|
||||||
|
search result- prevents buttons being incorrectly added or omitted.
|
||||||
|
|
||||||
Mon Sep 23 16:22 2013 CDT
|
Mon Sep 23 16:22 2013 CDT
|
||||||
* lib/user.js: distinguish search result return packets with a 'source'
|
* lib/user.js: distinguish search result return packets with a 'source'
|
||||||
field that specifies where the item came from (e.g 'yt' for youtube
|
field that specifies where the item came from (e.g 'yt' for youtube
|
||||||
|
|
|
@ -939,33 +939,26 @@ Callbacks = {
|
||||||
clearSearchResults();
|
clearSearchResults();
|
||||||
})
|
})
|
||||||
.insertBefore($("#library"));
|
.insertBefore($("#library"));
|
||||||
var p = $("#library").data("paginator");
|
var opts = {
|
||||||
if(p) {
|
preLoadPage: function () {
|
||||||
p.items = data.results;
|
$("#library").html("");
|
||||||
p.loadPage(0);
|
},
|
||||||
}
|
|
||||||
else {
|
|
||||||
var opts = {
|
|
||||||
preLoadPage: function () {
|
|
||||||
$("#library").html("");
|
|
||||||
},
|
|
||||||
|
|
||||||
generator: function (item, page, index) {
|
generator: function (item, page, index) {
|
||||||
var li = makeSearchEntry(item, false);
|
var li = makeSearchEntry(item, false);
|
||||||
if(hasPermission("playlistadd")) {
|
if(hasPermission("playlistadd")) {
|
||||||
addLibraryButtons(li, item.id, data.source);
|
addLibraryButtons(li, item.id, data.source);
|
||||||
}
|
}
|
||||||
$(li).appendTo($("#library"));
|
$(li).appendTo($("#library"));
|
||||||
},
|
},
|
||||||
|
|
||||||
itemsPerPage: 100
|
itemsPerPage: 100
|
||||||
};
|
};
|
||||||
|
|
||||||
p = Paginate(data.results, opts);
|
var p = Paginate(data.results, opts);
|
||||||
p.paginator.insertBefore($("#library"))
|
p.paginator.insertBefore($("#library"))
|
||||||
.attr("id", "search_pagination");
|
.attr("id", "search_pagination");
|
||||||
$("#library").data("paginator", p);
|
$("#library").data("paginator", p);
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/* REGION Polls */
|
/* REGION Polls */
|
||||||
|
|
Loading…
Reference in New Issue