mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-11-03 20:45:58 +01:00 
			
		
		
		
	lots of pagination work, query params, ajaxify to pids
This commit is contained in:
		@@ -28,23 +28,6 @@ SocketCategories.loadMore = function(socket, data, callback) {
 | 
			
		||||
	});
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
SocketCategories.loadPage = function(socket, data, callback) {
 | 
			
		||||
	if(!data) {
 | 
			
		||||
		return callback(new Error('invalid data'));
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	var topicsPerPage = parseInt(meta.config.topicsPerPage, 10) || 20;
 | 
			
		||||
 | 
			
		||||
	var start = (data.page - 1) * topicsPerPage,
 | 
			
		||||
		end = start + topicsPerPage - 1;
 | 
			
		||||
 | 
			
		||||
	categories.getCategoryTopics(data.cid, start, end, socket.uid, function(err, topics) {
 | 
			
		||||
		callback(err, {
 | 
			
		||||
			topics: topics
 | 
			
		||||
		});
 | 
			
		||||
	});
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SocketCategories.getPageCount = function(socket, cid, callback) {
 | 
			
		||||
	categories.getPageCount(cid, callback);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user