From 1eb593ea629fc5780df30dfadd65245755eab0e7 Mon Sep 17 00:00:00 2001 From: gschwab Date: Wed, 5 Mar 2014 14:58:04 +0100 Subject: [PATCH] fixed pagination on logs --- .../system/aardvark/frontend/js/views/logsView.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/js/apps/system/aardvark/frontend/js/views/logsView.js b/js/apps/system/aardvark/frontend/js/views/logsView.js index eeee3e647e..fb94785f96 100644 --- a/js/apps/system/aardvark/frontend/js/views/logsView.js +++ b/js/apps/system/aardvark/frontend/js/views/logsView.js @@ -28,6 +28,7 @@ "click #logTableID_prev" : "prevTable", "click #logTableID_next" : "nextTable" }, + firstTable: function () { if (this.offset !== 0) { this.offset = 0; @@ -36,6 +37,7 @@ this.collection.fillLocalStorage(this.table, this.offset, this.size); } }, + lastTable: function () { if (this.page !== this.totalPages) { this.totalPages = Math.ceil(this.totalAmount / this.size); @@ -45,6 +47,7 @@ this.collection.fillLocalStorage(this.table, this.offset, this.size); } }, + prevTable: function () { if (this.offset !== 0) { this.offset = this.offset - this.size; @@ -139,12 +142,14 @@ var self = this; var target = $('#logPaginationDiv'), options = { - left: 2, - right: 2, +// left: 2, +// right: 2, page: currentPage, lastPage: totalPages, click: function(i) { - if (i === 1 && i !== currentPage) { + var doSomething = false; + if (i === currentPage) { + } else if (i === 1 && i !== currentPage) { self.firstTable(); } else if (i === totalPages && i !== currentPage) { @@ -154,9 +159,10 @@ self.jumpToTable(i); } options.page = i; - target.pagination(options); +// target.pagination(options); } }; + target.html(""); target.pagination(options); $('#logPaginationDiv').prepend( '' ); }, + drawTable: function () { var self = this;