Ugh, crunchy bug waiting to happen here:

On Jan 6, 2012, at 2:08 PM, Walter Lee Davis wrote:

> document.observe('dom:loaded', function(evt){
>       var list = $$('addcomment');
>       $('thelist').observe('click', function(evt){
>               list.invoke('update','TEST2');
>               evt.element().update('TEST');
>       });
> });


document.observe('dom:loaded', function(evt){
        var list = $$('addcomment');
        $('thelist').observe('click', function(evt){
                list.invoke('update','TEST2');
                if (evt.findElement('li'))
                        evt.findElement('li').update('TEST');
        });
});

This keeps a click on an otherwise empty part of your list from triggering a 
replace of the entire list with TEST, or a big error message in console (more 
likely).

Walter

-- 
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.

Reply via email to