Commit b5871663 authored by Michael Ochmann's avatar Michael Ochmann
Browse files

added comments to `ListBox.js`

parent 8b843343
......@@ -43,9 +43,15 @@ ListBox.prototype.init = function () {
*/
ListBox.prototype.refresh = function () {
this.itemsPerPage = Math.floor(($("#list").outerHeight() - 50) / 42);
/**
* makes shure the user ist not on a page that does not exist
*/
if (this.currentPage >= this.pages()) {
this.currentPage = this.pages() - 1;
}
/**
* sets the output for the pagination in frontend
*/
$("#pagination").html(this.currentPage + 1 + "/" + this.pages());
this.renderPage(this.currentPage);
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment