cluster_search_ui/commit
Rewrote first part pagination generation.
author | Chris Dijkshoorn |
---|---|
Tue Dec 16 15:10:41 2014 +0100 | |
committer | Chris Dijkshoorn |
Tue Dec 16 15:10:41 2014 +0100 | |
commit | 5e946a6b996ad525d536f84b727ade3560beca2f |
tree | c92da6996e4448314a44ae018d976274e6572624 |
parent | 26cd2643f96878b2625f71951261eca71c9cb0f2 |
Diff style: patch stat
diff --git a/web/js/pagination.js b/web/js/pagination.js index 96b48db..e679d83 100644 --- a/web/js/pagination.js +++ b/web/js/pagination.js @@ -6,17 +6,26 @@ function initPagination(numberOfPages, clusterId) { if(numberOfPages==1) return ""; // Init HTML pagination string, starting with a disabled left arrow and an active first page - var html = '<div class="col-md-12"><ul class="pagination pagination-sm"><li class="disabled"><span>«</span></li><li class="active"><span>1</span></li>'; + var html = $.el.ul({'class':'pagination pagination-sm'}, + $.el.li({'class':'disabled'}, + $.el.span('\u00ab')), + $.el.li({'class':'active'}, + $.el.span(1))); // Add additional pages for(var i=2;i<=numberOfPages;i++){ - html += '<li><a href="javascript:goToPage(' + i + ', ' + clusterId + ')">' + i + '</a></li>'; - } + html.appendChild( + $.el.li($.el.a({'href':'javascript:goToPage(' + i + ', ' + clusterId + ')'}, + i))); + }; // Add right arrow to pagination - html += '<li><a href="javascript:nextPage(1' + ', ' + clusterId + ')">»</a></li></ul></div>'; - //return html; - return $.el.p($.el.b('pagination')); + html.appendChild( + $.el.li($.el.a({'href':'javascript:nextPage(1' + ', ' + clusterId + ')'}, + '\u00bb'))); + + return $.el.div({'class':'col-md-12'}, + html); } function changePagination(pageNumber, activePage, numberOfPages, clusterId) {