1
0
Fork 0
forked from wezm/wezm.net

Fix pagination controls

This commit is contained in:
Wesley Moore 2010-02-04 13:42:58 +11:00
parent 2961b40251
commit b310b66e2e
3 changed files with 7 additions and 7 deletions

View file

@ -52,9 +52,9 @@
<div class="pagination">
<% pagepath = @item.identifier; pagepath += 'page/' if pagepath !~ %r{/page/$} %>
<a href="<%= pagepath %>#2" class="newer">&laquo; Newer</a>
<a href="<%= pagepath %>" class="newer">&laquo; Newer</a>
|
<a href="<%= pagepath %>" class="older">Older &raquo;</a>
<a href="<%= pagepath %>#2" class="older">Older &raquo;</a>
</div>
</div>
<%= render '_footer' %>

View file

@ -145,7 +145,7 @@ body.articles #content {
display: none;
text-align: center;
}
.pagination .older {
.pagination .newer {
visibility: hidden;
}

View file

@ -18,12 +18,12 @@
};
function update_pagination_controls(page) {
var newer = $('.pagination .newer').attr('href', '#' + (page + 1));
var older = $('.pagination .older').attr('href', '#' + (page - 1));
var older = $('.pagination .older').attr('href', '#' + (page + 1));
var newer = $('.pagination .newer').attr('href', '#' + (page - 1));
// Hide if out of range
older.css('visibility', page <= 1 ? 'hidden' : 'visible');
newer.css('visibility', page * per_page >= articles.length ? 'hidden' : 'visible');
older.css('visibility', page * per_page >= articles.length ? 'hidden' : 'visible');
newer.css('visibility', page <= 1 ? 'hidden' : 'visible');
};
function articles_loaded(data) {