Skip to content

Commit

Permalink
Fix a bug in Sortable.destroy to make sure it's called on the referen…
Browse files Browse the repository at this point in the history
…ced Sortable only, which allows for the correct intialization of nested Sortables. Closes Trac #8615. [Leon Chevalier]
  • Loading branch information
madrobby committed Jul 25, 2008
1 parent efb38b6 commit a714120
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG
@@ -1,3 +1,5 @@
* Fix a bug in Sortable.destroy to make sure it's called on the referenced Sortable only, which allows for the correct intialization of nested Sortables. Closes Trac #8615. [Leon Chevalier]

* Change Effect.Base#render not to use eval(), so certain JavaScript runtime environments (like Adobe AIR) that do not support eval() work. [King Maxemilian, John-David Dalton]

* Fixed a calculation error in Effect.Transitions.pulse that could lead to flickering, add easing and change it to be a normal 0 to 1 transition that can be used with any effects; Effect.Pulsate now uses its own implementation. [Thomas Fuchs]
Expand Down
3 changes: 2 additions & 1 deletion src/dragdrop.js
Expand Up @@ -608,7 +608,8 @@ var Sortable = {
},

destroy: function(element){
var s = Sortable.options(element);
element = $(element);
var s = Sortable.sortables[element.id];

if(s) {
Draggables.removeObserver(s.element);
Expand Down
57 changes: 57 additions & 0 deletions test/functional/sortable_nested_test.html
@@ -0,0 +1,57 @@
<html>
<head>
<title>Nested Sortable element bug</title>
<script src="../../lib/prototype.js" type="text/javascript"></script>
<script src="../../src/scriptaculous.js" type="text/javascript"></script>
</head>
<body>

<ul id ="route">

<li id="39" class="segment">
<h2 id="39_title"> <span id="39_note" class="segment_title">COLLEGE AVE</span></h2>
<ul id="39_entries">
<li id="39:3" class="entry">625</li>
<li id="39:4" class="entry">617</li>
<li id="39:5" class="entry">601</li>
</ul>
</li>

<li id="40" class="segment">
<h2 id="40_title">Right <span id="40_note" class="segment_title">COLLEGE CT</span></h2>
<ul id="40_entries">
<li id="40:7" class="entry">14</li>
<li id="40:8" class="entry">27</li>
<li id="40:9" class="entry">30</li>
</ul>
</li>
</ul>

<script type="text/javascript">
Sortable.create(
"route",
{
handle:'segment_title',
format: /([0-9]+)/
}
);



Sortable.create("39_entries", {
dropOnEmpty:true,
constraint:false,
format: /[0-9]+:([0-9]+)/
}
);

Sortable.create("40_entries", {
dropOnEmpty:true,
constraint:false,
format: /[0-9]+:([0-9]+)/
}
);

</script>
</body>
</html>

0 comments on commit a714120

Please sign in to comment.