1
0
Fork 0

Merge branch 'devel' of https://github.com/triAGENS/ArangoDB into devel

This commit is contained in:
scottashton 2014-04-15 17:34:25 +02:00
commit e515acf6a2
1 changed files with 2 additions and 39 deletions

View File

@ -7,6 +7,7 @@
el: '#content',
id: '#logContent',
paginationDiv : "#logPaginationDiv",
idPrefix: "logTable",
initialize: function () {
this.convertModelToJSON();
@ -82,45 +83,7 @@
},
rerender : function () {
this.convertModelToJSON();
},
renderPagination: function () {
var self = this;
var currentPage = this.collection.getPage();
var totalPages = this.collection.getLastPageNumber();
var target = $('#logPaginationDiv'),
options = {
page: currentPage,
lastPage: totalPages,
click: function(i) {
if (i === 1 && i !== currentPage) {
self.collection.setPage(1);
}
else if (i === totalPages && i !== currentPage) {
self.collection.setPage(totalPages);
}
else if (i !== currentPage) {
self.collection.setPage(i);
}
options.page = i;
self.collection.fetch({
success: function() {
self.convertModelToJSON();
}
});
}
};
target.html("");
target.pagination(options);
$('#logPaginationDiv').prepend(
'<ul class="pre-pagi"><li><a id="logTable_first" class="pagination-button">'+
'<span><i class="fa fa-angle-double-left"/></span></a></li></ul>'
);
$('#logPaginationDiv').append(
'<ul class="las-pagi"><li><a id="logTable_last" class="pagination-button">'+
'<span><i class="fa fa-angle-double-right"/></span></a></li></ul>'
);
this.convertModelToJSON();
}
});
}());