Scroll on user page to get older posts.

This commit is contained in:
Pierre
2018-02-03 17:58:00 +01:00
parent 5c26e28e46
commit 12209718de
2 changed files with 76 additions and 9 deletions

View File

@ -10,14 +10,20 @@ ComunicWeb.components.posts.interface = {
* Get user posts
*
* @param {int} userID The ID of the target user
* @param {int} lastPostID The ID of the last post loaded
* @param {function} callback Callback function
*/
get_user: function(userID, callback){
get_user: function(userID, lastPostID, callback){
//Load the previous posts to the loaded post if required
if(lastPostID > 0)
lastPostID = lastPostID-1;
//Prepare the API request
var APIuri = "posts/get_user";
var params = {
userID: userID
userID: userID,
startFrom: lastPostID
};
//Make the request