$('body').addClass('infinite-scrolling');

// Append new data
$("<%=j render(:partial => 'timeline/pictures', :object => @pictures) %>")
  .appendTo($('#gallery'));

// Update next-page link
<% if @pictures.last_page? %>
  $('.next-page').html('');
  $('body').removeClass('infinite-scrolling');
<% else %>
  $('.next-page').html("<%=j link_to_next_page @pictures, t('pictures.gallery.load_more'), remote: true, class: 'btn btn-outline-secondary infinite-scrolling', role: 'button' %>");
<% end %>

$('body').addClass('infinite-scrolling');

// Append new data
$("<%=j render(:partial => 'timeline/pictures', :object => @pictures) %>")
  .appendTo($('#gallery'));

// Update timeago
$('time[data-time-ago]').timeago();

// Update next-page link
<% if @pictures.last_page? %>
  $('.next-page').html('');
  $('body').removeClass('infinite-scrolling');
<% else %>
  $('.next-page').html("<%=j link_to_next_page @pictures, t('pictures.gallery.load_more'), remote: true, class: 'btn btn-outline-secondary infinite-scrolling', role: 'button' %>");
<% end %>

Fix timeago in timeline load more
Fix timeago in timeline load more
