A calendar management project, for events and activities related to communities fighting for freedoms.
This can be related to software, art, data, hardware, content, commons, internet.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
809 B

$(document).on 'turbolinks:load', ->
$('table.list td.view a').each -> visit $(this)
# Automatic ajax pagination
$('.pagination .next a').attr('data-remote', true).each ->
# Go to the next page when page is scrolled
$(document).scroll =>
if $(this).visible true, true
# "Next" link is also hidden while pagination is done
$(document).on 'ajax:success', '.pagination .next a', (event, data) ->
.append($('tbody tr', data))
.find('td.view a').each ->
visit $(this)
next = $('.pagination .next a', data).attr 'href'
if next?
$(this).attr('href', next).parents('.pagination').show()
# Clicking on a table.list row
visit = (elt) =>
elt.closest('tr').click -> Turbolinks.visit elt.attr 'href'