From: Alexander Ebert Date: Wed, 4 Jul 2012 16:20:07 +0000 (+0200) Subject: Fixed a few issues with WCF.Sortable.List X-Git-Tag: 2.0.0_Beta_1~1032^2~1^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2a16194a3df9056c11b3b7aa4e334b0e874ae335;p=GitHub%2FWoltLab%2FWCF.git Fixed a few issues with WCF.Sortable.List --- diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index 869db8a5af..1198838853 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -4912,6 +4912,12 @@ WCF.Sortable = {}; * @param object options */ WCF.Sortable.List = Class.extend({ + /** + * additional parameters for AJAX request + * @var object + */ + _additionalParameters: { }, + /** * action class name * @var string @@ -4968,8 +4974,10 @@ WCF.Sortable.List = Class.extend({ * @param integer offset * @param object options * @param boolean isSimpleSorting + * @param object additionalParameters */ - init: function(containerID, className, offset, options, isSimpleSorting) { + init: function(containerID, className, offset, options, isSimpleSorting, additionalParameters) { + this._additionalParameters = additionalParameters || { }; this._containerID = $.wcfEscapeID(containerID); this._container = $('#' + this._containerID); this._className = className; @@ -5008,6 +5016,9 @@ WCF.Sortable.List = Class.extend({ * Saves object structure. */ _submit: function() { + // reset structure + this._structure = { }; + // build structure this._container.find('.sortableList').each($.proxy(function(index, list) { var $list = $(list); @@ -5027,15 +5038,17 @@ WCF.Sortable.List = Class.extend({ }, this)); // send request - this._proxy.setOption('data', { - actionName: 'updatePosition', - className: this._className, - parameters: { + var $parameters = $.extend(true, { data: { offset: this._offset, structure: this._structure } - } + }, this._additionalParameters); + + this._proxy.setOption('data', { + actionName: 'updatePosition', + className: this._className, + parameters: $parameters }); this._proxy.sendRequest(); },