Hi! I have a sortable list Every item in this list has a droppable area In this area I could drop some elements of the same list Everything is ok except I need to stop the sortable event when I drop an item in the droppable area Is this possible? Thanks!
on 2008-07-02 17:12
on 2008-07-02 18:14
I try to put a global var that prevents the bubble effect but the item
don't revert to its original position
Here my javascript:
<script type="text/javascript">
var bubbeling = false;
function Ordenar() {
if(bubbeling == false) { alert(Sortable.sequence('Tasques')); }
else { bubbeling = false; }
}
function FerDepenent(element, droppable, event) {
bubbeling = true;
alert(element.id + " a " + droppable.up().id);
}
document.observe('dom:loaded', function(){
Sortable.create('Tasques', {tag: 'div', only: 'Tasca', ghosting:
true, format: /(.*)/, onUpdate: Ordenar});
$$('.Tasca .Selector').each(function(element)
{
Droppables.add(element.id, {accept: 'Tasca', onDrop:
FerDepenent});
});
});
</script>
Some idea?
Thanks!