If you want to do somehting like alert('blah'); you must wrap it in an
anonymous function like this...
onUpdate : function(event) {
alert('Blah');
}
Alex Mcauley
http://www.thevacancymarket.com
----- Original Message -----
From: "JoJo" <[email protected]>
To: "Prototype & script.aculo.us" <[email protected]>
Sent: Sunday, August 16, 2009 7:50 AM
Subject: [Proto-Scripty] Re: Sortable onUpdate firing at the wrong time
I think I figured it out. The callback must not have parentheses.
FAIL: onUpdate: someFunction();
GOOD: onUpdate: someFunction;
I have no idea why. I am a beginner to JS.
On Aug 15, 11:17 pm, Mojito <[email protected]> wrote:
> Why is the onUpdate callback fired right when the Sortable is created
> and not when I move an <li>? This code also screws up my dropping - I
> am forced to click again to drop. Additionally, after dragging an
> <li>, it remains translucent even after dropping it.
>
> Sortable.create(
> 'lineup', {
> overlap: 'horizontal',
> constraint: 'horizontal',
> onUpdate: alert('onUpdate')
> }
> );
>
> <ul id="lineup">
> <li class="source" id="playlistItem_0">one</li>
> <li class="source" id="playlistItem_1">two</li>
> </ul>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---