Fixed jQuery pagination wrapper
authorAlexander Ebert <ebert@woltlab.com>
Tue, 21 Jun 2016 16:01:00 +0000 (18:01 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 21 Jun 2016 16:01:00 +0000 (18:01 +0200)
wcfsetup/install/files/js/WCF.js
wcfsetup/install/files/js/WoltLab/WCF/Ui/Pagination.js

index 6a4d1639b24bb10f9b008a4719904e95f05fc02f..06d40f7f4663e06a8799b06ffcc7da294d2b3ea5 100755 (executable)
@@ -7804,7 +7804,7 @@ $.widget('ui.wcfPages', {
         */
        _create: function() {
                require(['WoltLab/WCF/Ui/Pagination'], (function(UiPagination) {
-                       this._api = new UiPagination(this.element, {
+                       this._api = new UiPagination(this.element[0], {
                                activePage: this.options.activePage,
                                maxPage: this.options.maxPage,
                                
index 927bb280b179b163b288f4ae2632a8de7766b039..e53eda0685c88fac648b727f3bb64b6ba47d1191 100644 (file)
@@ -2,7 +2,7 @@
  * 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
  */
@@ -12,7 +12,7 @@ define(['Core', 'Language', 'ObjectMap', 'StringUtil', 'WoltLab/WCF/Ui/Page/Jump
        /**
         * @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
@@ -76,7 +76,7 @@ define(['Core', 'Language', 'ObjectMap', 'StringUtil', 'WoltLab/WCF/Ui/Page/Jump
                        }
                        
                        // add first page
-                       list.appendChild(this._createLink(1, this._options));
+                       list.appendChild(this._createLink(1));
                        
                        // calculate page links
                        var maxLinks = this.SHOW_LINKS - 4;
@@ -118,10 +118,10 @@ define(['Core', 'Language', 'ObjectMap', 'StringUtil', 'WoltLab/WCF/Ui/Page/Jump
                        var jumpToHtml = '<a class="jsTooltip" title="' + Language.get('wcf.global.page.jumpTo') + '">&hellip;</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);
@@ -132,16 +132,16 @@ define(['Core', 'Language', 'ObjectMap', 'StringUtil', 'WoltLab/WCF/Ui/Page/Jump
                        
                        // 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);
@@ -151,7 +151,7 @@ define(['Core', 'Language', 'ObjectMap', 'StringUtil', 'WoltLab/WCF/Ui/Page/Jump
                        }
                        
                        // 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');