This project is archived and is in readonly mode.

#457 ✓resolved
Peter

Sortables Detach/Attach duplicates lists

Reported by Peter | December 6th, 2010 @ 04:46 PM | in 1.3.1.1

In one of my projects i've found a strange behavior of the sortables class.

Simple Testcase: Create Sortables, call detach() and call attach() - now the initial list is duplicated.

I examined the source (current available release) and found something like this (pseudocode)

detach:
this.lists = removedLists (now this.lists contain the same like before)

attach:
addlists(this.lists)

which results in:
this.lists.push(this.lists)

because attach() calls addLists(...) with "this.lists" as an argument (which is filled with the removed Lists from detach())

Same happens, when calling attach() multiple times. Because it has no effect at all to add a single list multiple times, a simple check if the list is already added will resolve this issue.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

The MooTools Extensions

People watching this ticket

Pages