Simple RSS Reader inspired by Gxxgle Reader
Revisão | e92710676746060a66d27c6a9fefe1bbf1f79b4b (tree) |
---|---|
Hora | 2014-08-06 01:27:03 |
Autor | hylom <hylom@hylo...> |
Commiter | hylom |
add pager above article list
@@ -40,4 +40,16 @@ a { | ||
40 | 40 | font-size: 150%; |
41 | 41 | margin: 0; |
42 | 42 | padding: 0; |
43 | -} | |
\ No newline at end of file | ||
43 | +} | |
44 | + | |
45 | +#page-navigation-top { | |
46 | + margin-top: 8px; | |
47 | + margin-bottom: 8px; | |
48 | +} | |
49 | + | |
50 | +#page-navigation-bottom { | |
51 | + margin-top: 8px; | |
52 | + margin-bottom: 8px; | |
53 | +} | |
54 | + | |
55 | + |
@@ -4,7 +4,7 @@ | ||
4 | 4 | (function () { |
5 | 5 | // private functions |
6 | 6 | |
7 | - function updatePager(total, skip, count) { | |
7 | + function updatePager(total, skip, count, pager) { | |
8 | 8 | var totalPage = Math.floor((total - 1) / count + 1); |
9 | 9 | var currentPage = Math.floor((skip - 1) / count + 1); |
10 | 10 | var pane = $('#contentsPane'); |
@@ -35,11 +35,10 @@ | ||
35 | 35 | } |
36 | 36 | } |
37 | 37 | |
38 | - var paging = $('#page-navigation'); | |
39 | - paging.empty(); | |
38 | + pager.empty(); | |
40 | 39 | |
41 | 40 | if (pagerStart != 0) { |
42 | - paging.append($('<li class="disabled"><a href="#">...</a></li>')); | |
41 | + pager.append($('<li class="disabled"><a href="#">...</a></li>')); | |
43 | 42 | } |
44 | 43 | for (var i = pagerStart; i < pagerEnd; i++) { |
45 | 44 | anchor = $('<a href="#">'); |
@@ -50,10 +49,10 @@ | ||
50 | 49 | if (i == currentPage) { |
51 | 50 | elem.addClass('disabled'); |
52 | 51 | } |
53 | - paging.append(elem); | |
52 | + pager.append(elem); | |
54 | 53 | } |
55 | 54 | if (pagerEnd != totalPage) { |
56 | - paging.append($('<li class="disabled"><a href="#">...</a></li>')); | |
55 | + pager.append($('<li class="disabled"><a href="#">...</a></li>')); | |
57 | 56 | } |
58 | 57 | } |
59 | 58 |
@@ -85,7 +84,10 @@ | ||
85 | 84 | pane.attr('skip', data.skip); |
86 | 85 | pane.attr('count', data.count); |
87 | 86 | pane.attr('feedId', data.feedId); |
88 | - updatePager(data.total, data.skip, data.count); | |
87 | + var pagingTop = $('#page-navigation-top'); | |
88 | + var pagingBottom = $('#page-navigation-bottom'); | |
89 | + updatePager(data.total, data.skip, data.count, pagingTop); | |
90 | + updatePager(data.total, data.skip, data.count, pagingBottom); | |
89 | 91 | } |
90 | 92 | |
91 | 93 | function showFeed(feedId, skip, count) { |
@@ -12,6 +12,8 @@ block content | ||
12 | 12 | li: a.feedItem(href='#', feed-id=feed.feed_id) #{feed.title} |
13 | 13 | .col-md-9 |
14 | 14 | h4#feedTitle All Feeds: |
15 | + .paging | |
16 | + ul#page-navigation-top.pagination | |
15 | 17 | table.table#contentsPane |
16 | - #paging | |
17 | - ul#page-navigation.pagination | |
18 | + .paging | |
19 | + ul#page-navigation-bottom.pagination |