From: Alexander Ebert Date: Wed, 14 Nov 2012 17:58:07 +0000 (+0100) Subject: Fixed 'jump to page' X-Git-Tag: 2.0.0_Beta_1~778^2~5^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a19475d300441c7f333881f490ede33e87d5f6ee;p=GitHub%2FWoltLab%2FWCF.git Fixed 'jump to page' --- diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index b31d5c3258..10e4e7b7e7 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -5127,7 +5127,6 @@ WCF.System.PageNavigation = { } callback = callback || null; - if (callback !== null && !$.isFunction(callback)) { console.debug("[WCF.System.PageNavigation] Callback for selector '" + selector + "' is invalid, aborting."); return; @@ -5146,6 +5145,7 @@ WCF.System.PageNavigation = { var self = this; elements.each(function(index, element) { var $element = $(element); + console.debug($element.data()); var $elementID = $element.wcfIdentify(); if (self._elements[$elementID] === undefined) { self._elements[$elementID] = $element; @@ -5177,9 +5177,6 @@ WCF.System.PageNavigation = { this._description.html(WCF.Language.get('wcf.global.page.jumpTo.description').replace(/#pages#/, this._elements[this._elementID].data('pages'))); this._pageNo.val('1').attr('max', this._elements[this._elementID].data('pages')); - console.debug(this._elements[this._elementID]); - console.debug(this._elements[this._elementID].data()); - this._dialog.wcfDialog({ 'title': WCF.Language.get('wcf.global.page.pageNavigation') }); @@ -5209,6 +5206,7 @@ WCF.System.PageNavigation = { } else { $pageNavigation.data('callback')(this._pageNo.val()); + this._dialog.wcfDialog('close'); } } }; @@ -7752,15 +7750,10 @@ $.widget('ui.wcfPages', { $nextImage.addClass('icon16'); if ($hasHiddenPages) { - /* - * TODO: this is somehow broken, $pageList reflects something weird - * - - $pageList.data('max', this.options.maxPage); + $pageList.data('pages', this.options.maxPage); WCF.System.PageNavigation.init('#' + $pageList.wcfIdentify(), $.proxy(function(pageNo) { this.switchPage(pageNo); }, this)); - */ } } else { @@ -7830,7 +7823,7 @@ $.widget('ui.wcfPages', { nextPage: value }); - if ($result) { + if ($result || $result !== undefined) { this.options[key] = value; this._render(); this._trigger('switched', undefined, {