Remove legacy pagination

This commit is contained in:
Andreas Nedbal 2022-09-08 23:42:09 +02:00 committed by Andreas Nedbal
parent 62b53d8740
commit 6ee96446dc
3 changed files with 1 additions and 30 deletions

View File

@ -1,16 +0,0 @@
$(document).on 'ready turbo:load', ->
if $('#pagination').length > 0
$('#pagination').hide()
loading_posts = false
$('#load-more-btn').show().click ->
unless loading_posts
loading_posts = true
more_posts_url = $('#pagination .pagination .next a').attr('href')
$this = $(this)
$this.html('<i class="fa fa-spinner fa-spin"></i>').addClass('disabled')
$.getScript more_posts_url, ->
$this.text('Load more').removeClass('disabled') if $this
loading_posts = false
$('[data-toggle="tooltip"]').tooltip()
return

View File

@ -5,8 +5,6 @@ import '../legacy/jquery'
import 'popper.js' import 'popper.js'
import 'bootstrap' import 'bootstrap'
import '../legacy/pagination'
_ready = -> _ready = ->
$('[data-toggle="tooltip"]').tooltip() $('[data-toggle="tooltip"]').tooltip()
$('.dropdown-toggle').dropdown() $('.dropdown-toggle').dropdown()

View File

@ -1,11 +0,0 @@
-# this renders a pagination html to keep compatibility with the current pagination js
it _should_ be replaced with something else entirely later on.
- permitted_params ||= []
#pagination
%ul.pagination
%li.next{ class: more_data_available ? nil : :disabled }
- if more_data_available
%a{ rel: :next, href: url_for(params.permit(*permitted_params).merge(last_id: last_id)) }
Next page
- else
Next page