Ryan Morris
2006-Nov-18 19:09 UTC
passing multiple elements to Element methods (hide, show, etc)
Hey I recently upgraded to the new scriptaculous (1.65 if I remember correctly), which requires the new rc of prototype (1.51rc1). Problem is, this has caused a number of my scripts to break. In the old prototype 1.4, one could pass multiple elements to the Element methods (ala: Element.hide(''el1'', ''el2'', ''el3''); ).. but that functionality seems to have been given the miss in the new versions of prototype. I''m hoping that this will be re-implemented in some way, but in the mean time I''m wondering if I''m just missing something here -- or if I should give up hope and rewrite all these calls as [arraylist].each(Element.hide) ? Thanks! Ryan --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Martin Ström
2006-Dec-03 14:06 UTC
Re: passing multiple elements to Element methods (hide, show, etc)
I don''t think it will be re-implanted but if your scripts depends on it you could just overwrite the function in your own script but still be able to use the latest prototype library. Like: Element._old_hide = Element.hide, Element._old_show = Element.show; Element.hide = function() { $A(arguments).each(Element._old_hide); } Element.show = function() { $A(arguments).each(Element._old_show); } Ciao Martin -- burnfield.com/martin On 11/18/06, Ryan Morris <mr.morris-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hey > > I recently upgraded to the new scriptaculous (1.65 if I remember > correctly), which requires the new rc of prototype (1.51rc1). Problem > is, this has caused a number of my scripts to break. > > In the old prototype 1.4, one could pass multiple elements to the > Element methods (ala: Element.hide(''el1'', ''el2'', ''el3''); ).. but that > functionality seems to have been given the miss in the new versions of > prototype. > > I''m hoping that this will be re-implemented in some way, but in the > mean time I''m wondering if I''m just missing something here -- or if I > should give up hope and rewrite all these calls as > [arraylist].each(Element.hide) ? > > Thanks! > > Ryan > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---