 
     if @jumpTo $(e.target).find('[name="n"]').val()
       $.publish 'forum:topic:jumpTo'
+
+  moreMeta: (link) =>
+    mode = link.dataset.mode
+
+    if mode == 'previous'
+      refPost = @posts[0]
+      sort = 'id_desc'
+    else
+      refPost = @endPost()
+      sort = 'id_asc'
+
+    query = $.param
+      skip_layout: 1
+      with_deleted: +@showDeleted()
+      sort: sort
+      cursor:
+        post_id: refPost.dataset.postId
+
+    url: "#{window.canonicalUrl}?#{query}"
+    refPost: refPost
+    mode: mode

    if lastPostLoaded
      $(@endPost()).find('.js-post-delete-toggle').css(display: '')


  refreshCounter: =>
    return if @_postsCounter.length == 0

  showMore: (e) =>
    e.preventDefault()

    link = e.currentTarget

    return if link.classList.contains('js-disabled')

    link.classList.add 'js-disabled'

    moreMeta = @moreMeta link

    $.get(moreMeta.url)
    .done (data) =>
      scrollReference = moreMeta.refPost
      scrollReferenceTop = scrollReference.getBoundingClientRect().top

      if moreMeta.mode == 'previous'
        link.insertAdjacentHTML 'afterend', data
        toRemoveStart = @maxPosts
        toRemoveEnd = @posts.length
      else
        link.insertAdjacentHTML 'beforebegin', data
        toRemoveStart = 0
        toRemoveEnd = @posts.length - @maxPosts

