I was looking at the source code for camelize and I am unclear what the following line does: var camelizedString = this.indexOf(''-'') == 0 ? oStringList[0].charAt(0).toUpperCase() + oStringList[0].substring(1) : oStringList[0]; From what I can tell the function will turn something like "project-edit" into projectEdit. Looks like prototype uses this for converting between CSS style syntax for CSS properties and Javascript style syntax for CSS properties. What I don''t get is the case where the string start with "-". The function splits the string on "-" and assigns that to oStringList. If the string starts with "-" won''t that mean the first element of oStringList is an empty string? I am guessing this function is trying to deal with the browser specific CSS properties such as -moz-outline but it seems that code does nothing. Seems that you could just do: var camelizedString = oStringList[0]; and achieve the same thing. Am I missing something? Eric
On 6/3/06, Eric Anderson <eric-ANzg6odk14w@public.gmane.org> wrote:> Seems that you could just do: > > var camelizedString = oStringList[0]; > > and achieve the same thing. Am I missing something?No. http://dev.rubyonrails.org/ticket/4170 Bye, Martin
Looks like that ticket is languishing -- maybe the owner can create a patch, unit test(s) and tag it with the right keywords? On 6/4/06, Martin Bialasinski <klingeling-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 6/3/06, Eric Anderson <eric-ANzg6odk14w@public.gmane.org> wrote: > > Seems that you could just do: > > > > var camelizedString = oStringList[0]; > > > > and achieve the same thing. Am I missing something? > > No. http://dev.rubyonrails.org/ticket/4170 > > Bye, > Martin > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >