From 83a29d77c194180989099909d956605c55489c3a Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 4 Jul 2012 16:05:14 +0200 Subject: [PATCH] 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. --- wcfsetup/install/files/js/WCF.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) 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 -- 2.20.1