The pagination mechanism now relies on a jquery visible gem, which checks if/when the next link is visible

remotes/origin/master
echarp 4 years ago
parent fc3498d2cb
commit 244a0a8fce
  1. 4
      Gemfile
  2. 4
      Gemfile.lock
  3. 1
      app/assets/javascripts/application.js.coffee
  4. 9
      app/assets/javascripts/pagination.coffee
  5. 2
      public/assets/.sprockets-manifest-a96f801165acf45de4294ace1ce0c35a.json
  6. 33123
      public/assets/active_admin-b72df732a2f6946716a2f3950a3b2691726f67f7ce55683b78ca2cef50f2f9c4.js
  7. BIN
      public/assets/active_admin-b72df732a2f6946716a2f3950a3b2691726f67f7ce55683b78ca2cef50f2f9c4.js.gz
  8. 61858
      public/assets/application-52ef41ca4b7a02fcc3817c26caf1650f74aeb37ed6078389eb5d50f251e118c3.js
  9. BIN
      public/assets/application-52ef41ca4b7a02fcc3817c26caf1650f74aeb37ed6078389eb5d50f251e118c3.js.gz

@ -119,7 +119,7 @@ group :development, :test, :assets do
# Use SASS for stylesheets
gem 'sass-rails'
# Use jquery as the JavaScript library
# Use jquery and jquery-ui as the JavaScript library
gem 'jquery-ui-rails'
# Turbolinks makes following links in your web application
# faster. Read more: https://github.com/rails/turbolinks
@ -132,9 +132,9 @@ group :development, :test, :assets do
# A superb font to use as icons
gem 'font-awesome-sass'
# Carte openstreetmap
source 'https://rails-assets.org' do
gem 'rails-assets-jquery-sparkline'
gem 'rails-assets-jquery-visible'
gem 'rails-assets-leaflet'
gem 'rails-assets-leaflet.markercluster'
end

@ -302,7 +302,10 @@ GEM
bundler (>= 1.3.0)
railties (= 5.2.0)
sprockets-rails (>= 2.0.0)
rails-assets-jquery (3.3.1)
rails-assets-jquery-sparkline (2.1.3)
rails-assets-jquery-visible (1.2.0)
rails-assets-jquery (> 1.6.0)
rails-assets-leaflet (1.3.1)
rails-assets-leaflet.markercluster (1.3.0)
rails-assets-leaflet (>= 1.0.3)
@ -491,6 +494,7 @@ DEPENDENCIES
rack-livereload
rails (>= 5.1.4)
rails-assets-jquery-sparkline!
rails-assets-jquery-visible!
rails-assets-leaflet!
rails-assets-leaflet.markercluster!
rails-controller-testing

@ -15,6 +15,7 @@
# For tags input
#= require jquery-ui/widgets/autocomplete
#= require jquery.tagsinput
#= require jquery-visible
#= require turbolinks
#= require tinymce-jquery
#= require modernizr

@ -22,8 +22,7 @@ $(document).on 'turbolinks:load', ->
return $(this).parents('.pagination').remove()
# Go to the next page when page is scrolled
if $('.pagination .next a').size() > 0
$(document).scroll ->
if $(window).scrollTop() == $(document).height() - $(window).height() && $('.pagination .next a').is(':visible')
# "Next" link is also hidden while pagination is done
$('.pagination .next a').hide().click()
$(document).scroll ->
$('.pagination .next a:visible').filter =>
this.visible()
.hide().click() # "Next" link is hidden while pagination is done

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save