@Alex, in MDL all is className-based and we need to add and remove without
duplicating it, so I think is for me (developer) to provide an easy MDL
API, but all users will use this behind and if they need something new,
they will need to use it directly. I think this will be very used.

typeNames will not be of much help here. I have lots of methods to add
class to component and expect users to, for example, use a checkbox to set
a property to true/false, so each time they do this, will end appending a
className or not having effect cause the other className is still in
place...

@Josh, I think that's the way to go...

I think nobody cares about IE9 today right? is ok to go with classList?
I think I could use this in MDL directly so not need to introduce nothing
in HTML.swc




2016-11-26 18:00 GMT+01:00 Josh Tynjala <joshtynj...@gmail.com>:

> https://developer.mozilla.org/en-US/docs/Web/API/Element/classList
>
> classList should probably be used, when available. Basically, anything
> except IE9.
>
> - Josh
>
> On Nov 26, 2016 4:54 AM, "Carlos Rovira" <carlosrov...@apache.org> wrote:
>
> > Hi.
> >
> > with CSS class we need to insert and remove class without affect the rest
> > of them. So I propose to introduce two methods:
> >
> > appendClassName (className:String):Boolean;
> > removeClassName (className:String):Boolean;
> >
> > This methods will be based on RegExp to see if the className is already
> in
> > the String or not and return a boolean true if the className was inserted
> > or false if it's not (so the class was already there).
> >
> > I will do this in UIBase, but checking the hierarchy, I think this is
> > something very close to HTML so maybe className manipulation should be in
> > Element class?
> >
> > I'll be working on this in the meanwhile and always we can refactor to
> > other place
> >
> > --
> > Carlos Rovira
> > http://about.me/carlosrovira
> >
>



-- 

Carlos Rovira
Director General
M: +34 607 22 60 05
http://www.codeoscopic.com
http://www.avant2.es

Este mensaje se dirige exclusivamente a su destinatario y puede contener
información privilegiada o confidencial. Si ha recibido este mensaje por
error, le rogamos que nos lo comunique inmediatamente por esta misma vía y
proceda a su destrucción.

De la vigente Ley Orgánica de Protección de Datos (15/1999), le comunicamos
que sus datos forman parte de un fichero cuyo responsable es CODEOSCOPIC
S.A. La finalidad de dicho tratamiento es facilitar la prestación del
servicio o información solicitados, teniendo usted derecho de acceso,
rectificación, cancelación y oposición de sus datos dirigiéndose a nuestras
oficinas c/ Paseo de la Habana 9-11, 28036, Madrid con la documentación
necesaria.

Reply via email to