mirror of
https://github.com/wezm/wezm.net.git
synced 2024-11-18 12:52:47 +00:00
Fix pagination controls
This commit is contained in:
parent
2961b40251
commit
b310b66e2e
3 changed files with 7 additions and 7 deletions
|
@ -52,9 +52,9 @@
|
|||
|
||||
<div class="pagination">
|
||||
<% pagepath = @item.identifier; pagepath += 'page/' if pagepath !~ %r{/page/$} %>
|
||||
<a href="<%= pagepath %>#2" class="newer">« Newer</a>
|
||||
<a href="<%= pagepath %>" class="newer">« Newer</a>
|
||||
|
|
||||
<a href="<%= pagepath %>" class="older">Older »</a>
|
||||
<a href="<%= pagepath %>#2" class="older">Older »</a>
|
||||
</div>
|
||||
</div>
|
||||
<%= render '_footer' %>
|
||||
|
|
|
@ -145,7 +145,7 @@ body.articles #content {
|
|||
display: none;
|
||||
text-align: center;
|
||||
}
|
||||
.pagination .older {
|
||||
.pagination .newer {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue