From: Alexander Ebert Date: Wed, 4 Jul 2012 14:05:14 +0000 (+0200) Subject: Added ability to ignore list items in structure X-Git-Tag: 2.0.0_Beta_1~1032^2~1^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=83a29d77c194180989099909d956605c55489c3a;p=GitHub%2FWoltLab%2FWCF.git Added ability to ignore list items in structure If you omit the object type id for a .sortableList-element it will not be considered as part of the structure. Useful if you're dragging elements between two lists, where one list should be ignored. --- diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index b59244a99c..869db8a5af 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -5013,15 +5013,17 @@ WCF.Sortable.List = Class.extend({ var $list = $(list); var $parentID = $list.data('objectID'); - $list.children(this._options.items).each($.proxy(function(index, listItem) { - var $objectID = $(listItem).data('objectID'); - - if (!this._structure[$parentID]) { - this._structure[$parentID] = [ ]; - } - - this._structure[$parentID].push($objectID); - }, this)); + if ($parentID !== undefined) { + $list.children(this._options.items).each($.proxy(function(index, listItem) { + var $objectID = $(listItem).data('objectID'); + + if (!this._structure[$parentID]) { + this._structure[$parentID] = [ ]; + } + + this._structure[$parentID].push($objectID); + }, this)); + } }, this)); // send request