lots of pagination work, query params, ajaxify to pids

This commit is contained in:
Baris Soner Usakli
2014-01-25 19:19:25 -05:00
parent 8744013013
commit 1084523c92
13 changed files with 144 additions and 164 deletions

View File

@@ -52,24 +52,10 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
}
});
} else {
pagination.init(templates.get('currentPage'), templates.get('pageCount'), loadPage);
pagination.init(templates.get('currentPage'), templates.get('pageCount'));
}
}
function loadPage(page, callback) {
socket.emit('categories.loadPage', {cid: templates.get('category_id'), page: page}, function(err, data) {
if(err) {
return callback(err);
}
if (data && data.topics && data.topics.length) {
Category.onTopicsLoaded(data.topics);
}
callback(null);
});
}
Category.onNewTopic = function(data) {
var html = templates.prepare(templates['category'].blocks['topics']).parse({
topics: [data]