From 66ed9925cef3ca7bca83d700074293465457c6a6 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 2 May 2014 18:04:05 +0200 Subject: [PATCH] Improved WCF.System.Page.Multiple --- wcfsetup/install/files/acp/js/WCF.ACP.js | 4 +--- wcfsetup/install/files/js/WCF.js | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/wcfsetup/install/files/acp/js/WCF.ACP.js b/wcfsetup/install/files/acp/js/WCF.ACP.js index c603d7c577..a9e9fa6213 100644 --- a/wcfsetup/install/files/acp/js/WCF.ACP.js +++ b/wcfsetup/install/files/acp/js/WCF.ACP.js @@ -1218,9 +1218,7 @@ WCF.ACP.Package.Search = Class.extend({ } }); -WCF.ACP.Package.Server = { - -}; +WCF.ACP.Package.Server = { }; WCF.ACP.Package.Server.Installation = Class.extend({ _proxy: null, diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index 05c3ff9184..234578599d 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -6660,6 +6660,7 @@ WCF.System.Page.Multiple = Class.extend({ _options: { }, _pageNo: 1, _pages: 0, + _previousPageNo: 0, init: function(options) { this._options = $.extend({ @@ -6670,6 +6671,17 @@ WCF.System.Page.Multiple = Class.extend({ // callbacks loadItems: null }, options); + + this._cache = { }; + this._pageNo = 1; + this._pages = 0; + this._previousPageNo = 0; + + if (this._pagination.data('pages')) { + this._pagination.wcfPages({ + maxPage: this._pagination.data('pages') + }).on('wcfpagesswitched', $.proxy(this._showPage, this)); + } }, /** @@ -6698,7 +6710,7 @@ WCF.System.Page.Multiple = Class.extend({ } } else { - this._loadItems(); + this._options.loadItems(); } }, @@ -6707,6 +6719,10 @@ WCF.System.Page.Multiple = Class.extend({ activePage: pageNo, template: template }); + }, + + getPageNo: function() { + return this._pageNo; } }); -- 2.20.1