From 6ee96446dc9a70a90f6cea7998f0f102f56a7c04 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Thu, 8 Sep 2022 23:42:09 +0200 Subject: [PATCH] Remove legacy pagination --- app/javascript/legacy/pagination.coffee | 16 ---------------- app/javascript/packs/legacy.coffee | 4 +--- app/views/shared/_cursored_pagination_dummy.haml | 11 ----------- 3 files changed, 1 insertion(+), 30 deletions(-) delete mode 100644 app/javascript/legacy/pagination.coffee delete mode 100644 app/views/shared/_cursored_pagination_dummy.haml diff --git a/app/javascript/legacy/pagination.coffee b/app/javascript/legacy/pagination.coffee deleted file mode 100644 index e45bb39f..00000000 --- a/app/javascript/legacy/pagination.coffee +++ /dev/null @@ -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('').addClass('disabled') - $.getScript more_posts_url, -> - $this.text('Load more').removeClass('disabled') if $this - loading_posts = false - $('[data-toggle="tooltip"]').tooltip() - return diff --git a/app/javascript/packs/legacy.coffee b/app/javascript/packs/legacy.coffee index 05e3807e..27076844 100644 --- a/app/javascript/packs/legacy.coffee +++ b/app/javascript/packs/legacy.coffee @@ -5,11 +5,9 @@ import '../legacy/jquery' import 'popper.js' import 'bootstrap' -import '../legacy/pagination' - _ready = -> $('[data-toggle="tooltip"]').tooltip() $('.dropdown-toggle').dropdown() $(document).ready _ready -$(document).on 'turbo:load', _ready \ No newline at end of file +$(document).on 'turbo:load', _ready diff --git a/app/views/shared/_cursored_pagination_dummy.haml b/app/views/shared/_cursored_pagination_dummy.haml deleted file mode 100644 index 5f0571e8..00000000 --- a/app/views/shared/_cursored_pagination_dummy.haml +++ /dev/null @@ -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