Hi, I code the API we talked about in the previous email. Is in the UIBase copy in Jewel lib
Some things to notice as you review: * I put COMPILE::JS in each method, but maybe the methods should be for all platforms and use COMPILE::XX in the body * typeNames comes back as a public var without getter/setters * In addedToParent I call setClassName(computeFinalClassNames()) (this makes the components with properties reach sooner than this call, is there some way to make this reach the first?) * className setter as well calls setClassName(computeFinalClassNames()) * computeFinalClassNames has a StringUtil.trim, maybe this could be a problem but don't know other way to ensure there's no spaces left, since if not this comes a problem for the latter split * setClassName calls new API "addStyles" * New API is composed of: addStyles -> is where all complicated logic is, this is the point where all converges, is this the best way to get this? some better alterantive? let me know. Here I care for empty strings and for one style strings vs multiple separated by spaces removeStyles -> the counterpart to the previous method toggleStyles -> this is straight forward removeAllStyles -> This loop seems to be more performant than className="" and I'm taking care of not removing typeNames in the process (I didn't create versions for contains and item classList methods since it seems not useful for us) Thoughts? -- Carlos Rovira http://about.me/carlosrovira
