About pagination ajaxify


  • Plugin & Theme Dev

    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 style

    my question is, where is the function that control this page increment and how can i detect a new page been made?

    thank you


  • Admin


  • Plugin & Theme Dev

    @baris said in About pagination ajaxify:

    https://github.com/NodeBB/NodeBB/blob/master/public/src/client/topic/posts.js#L17

    Look at the function onNewPostPagination

    all right, thank you
    how can i detect that update pagination event or build my own function updatePagination() {?


  • Translator

    @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.


Log in to reply
 

Looks like your connection to NodeBB was lost, please wait while we try to reconnect.