Fixed pagination for phrases
authorAlexander Ebert <ebert@woltlab.com>
Tue, 21 Jun 2016 16:01:09 +0000 (18:01 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 21 Jun 2016 16:01:09 +0000 (18:01 +0200)
wcfsetup/install/files/acp/js/WCF.ACP.Language.js

index 342397373f409df8c19e7f2053add37012ad7164..5c50d83084a5d54b2cbcadcd635d820fc47321e5 100644 (file)
@@ -51,7 +51,7 @@ WCF.ACP.Language.ItemList = Class.extend({
                        $button.click(function() { self._click($languageItemID); });
                }, this));
                
-               count = parseInt(count) || 0;
+               count = ~~count;
                if (count > 100) {
                        this._createPagination(count, pageNo);
                }
@@ -64,11 +64,18 @@ WCF.ACP.Language.ItemList = Class.extend({
         * @param       integer         pageNo
         */
        _createPagination: function(count, pageNo) {
-               $('.contentNavigation').each(function(index, contentNavigation) {
-                       var $contentNavigation = $(contentNavigation);
-                       var $nav = $('<nav />').prependTo($contentNavigation);
-                       
-                       $nav.wcfPages({
+               var navs = [];
+               
+               // pagination top
+               var contentNavigation = $('<div class="paginationTop"><nav class="pagination" /></div>').insertBefore($('.section.sectionContainerList'));
+               navs.push(contentNavigation[0].children[0]);
+               
+               // pagination bottom
+               contentNavigation = $('<div class="paginationBottom"><nav class="pagination" /></div>').prependTo($('.contentFooter'));
+               navs.push(contentNavigation[0].children[0]);
+               
+               navs.forEach(function(nav) {
+                       $(nav).wcfPages({
                                activePage: parseInt(pageNo) || 1,
                                maxPage: Math.ceil(count / 100)
                        }).on('wcfpagesswitched', function(event, data) {