diff --git a/frontend/index.html b/frontend/index.html index 42b7842445..4a5dca99fe 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -62,6 +62,7 @@ + diff --git a/frontend/js/collections/arangoDocuments.js b/frontend/js/collections/arangoDocuments.js index b5c61d1836..6bd24096a5 100644 --- a/frontend/js/collections/arangoDocuments.js +++ b/frontend/js/collections/arangoDocuments.js @@ -86,6 +86,7 @@ window.arangoDocuments = Backbone.Collection.extend({ }); }); window.documentsView.drawTable(); + window.documentsView.renderPagination(self.totalPages); } else { window.documentsView.initTable(); diff --git a/frontend/js/lib/bootstrap-pagination.js b/frontend/js/lib/bootstrap-pagination.js new file mode 100644 index 0000000000..677d4ecaa8 --- /dev/null +++ b/frontend/js/lib/bootstrap-pagination.js @@ -0,0 +1,138 @@ +(function($) { +$.fn.pagination = function(o) { + var prevText = o.prevText ? o.prevText : '<<'; + var nextText = o.nextText ? o.nextText : '>>'; + var moreText = o.moreText ? o.moreText :'...'; + var isDisplayFirst = o.isDisplayFirst || true; + var isDisplayLast = o.isDisplayLast || true; + var current = o.current ? o.current : 1; + var count = o.count ? o.count : 0; + var link = o.link ? o.link : '#?page={p}'; + var displayCount = o.displayCount ? o.displayCount : 7; + + var me = $(this); + +console.log(current); + + me.initPagination = function () { + // 创建 ul + var ul = $('