About pagination ajaxify
-
Hello
i have changed pagination style on threads with a new lib to make it more friendly and draggable on mobiles
problem is while you reading a thread and new post been made, if it reached you page limit and a new page is created it breaks my new stylemy question is, where is the function that control this page increment and how can i detect a new page been made?
thank you
-
NodeBB/public/src/client/topic/posts.js at master · NodeBB/NodeBB
Node.js based forum software built for the modern web - NodeBB/public/src/client/topic/posts.js at master · NodeBB/NodeBB
GitHub (github.com)
Look at the function
onNewPostPagination
-
@baris said in About pagination ajaxify:
NodeBB/public/src/client/topic/posts.js at master · NodeBB/NodeBB
Node.js based forum software built for the modern web - NodeBB/public/src/client/topic/posts.js at master · NodeBB/NodeBB
GitHub (github.com)
Look at the function
onNewPostPagination
all right, thank you
how can i detect that update pagination event or build my own function updatePagination() {? -
@baris would be nice to have the pagination component build as a plugin. That way people could just use the same hooks at the actual component and modify or implement different ways of pagination.
I think that if i would want to build a different way of pagination (lets say, use a lib for that) even if i use the same hook for pagination socket.on('event:new_post', onNewPost); , because the pagination code still present in the core of nodebb, that code would execute anyway, so even if i use my own code to paginate, the core code would execute, even it would not needed at all.
I think it should not be difficult to migrate the pagination mechanism to a plugin, as it was made for the composer. Or maybe the bast majority of the core code should still present but a few new hooks should be created.
Powerfull and more usefull IMO.