diff --git a/app/assets/javascripts/paginator.js b/app/assets/javascripts/paginator.js index 0e6c9c68e..8a572cc85 100644 --- a/app/assets/javascripts/paginator.js +++ b/app/assets/javascripts/paginator.js @@ -2,14 +2,16 @@ Danbooru.Paginator = {}; Danbooru.Paginator.next_page = function() { - if ($('.paginator li span').parent().next().length) { - window.location = $('.paginator li span').parent().next().find('a').attr('href'); + var href = $(".paginator a[rel=next]").attr("href"); + if (href) { + window.location = href; } } Danbooru.Paginator.prev_page = function() { - if ($('.paginator li span').parent().prev().length) { - window.location = $('.paginator li span').parent().prev().find('a').attr('href'); + var href = $(".paginator a[rel=prev]").attr("href"); + if (href) { + window.location = href; } } })(); diff --git a/app/helpers/pagination_helper.rb b/app/helpers/pagination_helper.rb index c3d7e3950..880dc14e7 100644 --- a/app/helpers/pagination_helper.rb +++ b/app/helpers/pagination_helper.rb @@ -4,10 +4,10 @@ module PaginationHelper if records.any? if params[:page] =~ /[ab]/ - html << '
  • ' + link_to("< Previous", params.merge(:page => "a#{records[0].id}")) + '
  • ' + html << '
  • ' + link_to("< Previous", params.merge(:page => "a#{records[0].id}"), :rel => "prev") + '
  • ' end - html << '
  • ' + link_to("Next >", params.merge(:page => "b#{records[-1].id}")) + '
  • ' + html << '
  • ' + link_to("Next >", params.merge(:page => "b#{records[-1].id}"), :rel => "next") + '
  • ' end html << "" @@ -27,7 +27,7 @@ module PaginationHelper window = 3 if records.current_page >= 2 - html << "
  • " + link_to("<<", params.merge(:page => records.current_page - 1)) + "
  • " + html << "
  • " + link_to("<<", params.merge(:page => records.current_page - 1), :rel => "prev") + "
  • " end if records.total_pages <= (window * 2) + 5 @@ -65,7 +65,7 @@ module PaginationHelper end if records.current_page < records.total_pages && records.size > 0 - html << "
  • " + link_to(">>", params.merge(:page => records.current_page + 1)) + "
  • " + html << "
  • " + link_to(">>", params.merge(:page => records.current_page + 1), :rel => "next") + "
  • " end html << "" diff --git a/app/views/post_sets/_blank.html.erb b/app/views/post_sets/_blank.html.erb index 56eb23be4..e711d5c67 100644 --- a/app/views/post_sets/_blank.html.erb +++ b/app/views/post_sets/_blank.html.erb @@ -1,3 +1,3 @@

    Nobody here but us chickens!

    -

    <%= link_to "Go back", :back %>

    \ No newline at end of file +

    <%= link_to "Go back", :back, :rel => "prev" %>

    \ No newline at end of file