* Callback-based pagination.
*
* @author Alexander Ebert
- * @copyright 2001-2015 WoltLab GmbH
+ * @copyright 2001-2016 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @module WoltLab/WCF/Ui/Pagination
*/
/**
* @constructor
*/
- function UiPagination(element, options) { this.init(element, options); };
+ function UiPagination(element, options) { this.init(element, options); }
UiPagination.prototype = {
/**
* maximum number of displayed page links, should match the PHP implementation
}
// add first page
- list.appendChild(this._createLink(1, this._options));
+ list.appendChild(this._createLink(1));
// calculate page links
var maxLinks = this.SHOW_LINKS - 4;
var jumpToHtml = '<a class="jsTooltip" title="' + Language.get('wcf.global.page.jumpTo') + '">…</a>';
if (left > 1) {
if (left - 1 < 2) {
- list.appendChild(this._createLink(2, this._options));
+ list.appendChild(this._createLink(2));
}
else {
- var listItem = elCreate('li');
+ listItem = elCreate('li');
listItem.className = 'jumpTo';
listItem.innerHTML = jumpToHtml;
list.appendChild(listItem);
// visible links
for (var i = left + 1; i < right; i++) {
- list.appendChild(this._createLink(i, this._options));
+ list.appendChild(this._createLink(i));
}
// right ... links
if (right < this._options.maxPage) {
if (this._options.maxPage - right < 2) {
- list.appendChild(this._createLink(this._options.maxPage - 1, this._options));
+ list.appendChild(this._createLink(this._options.maxPage - 1));
}
else {
- var listItem = elCreate('li');
+ listItem = elCreate('li');
listItem.className = 'jumpTo';
listItem.innerHTML = jumpToHtml;
list.appendChild(listItem);
}
// add last page
- list.appendChild(this._createLink(this._options.maxPage, this._options));
+ list.appendChild(this._createLink(this._options.maxPage));
// add next button
listItem = elCreate('li');