2022-09-04 05:34:40 -07:00
|
|
|
$(document).on 'ready turbo:load', ->
|
2020-04-28 04:26:20 -07:00
|
|
|
if $('#pagination').length > 0
|
2014-12-08 05:14:13 -08:00
|
|
|
$('#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
|
2015-01-15 08:47:54 -08:00
|
|
|
$('[data-toggle="tooltip"]').tooltip()
|
2015-01-06 09:56:43 -08:00
|
|
|
return
|