What about exposing an addClass method to StyledUIBase?

Something like this:
Public function addClass(name:String):void{
        COMPILE::JS{
          classSelectorList.add(name);
        }
}
I think that would simplify code an eliminate the need to deal with the element 
directly.

Harbs

> On Jun 8, 2018, at 4:37 PM, [email protected] wrote:
> 
> This is an automated email from the ASF dual-hosted git repository.
> 
> carlosrovira pushed a commit to branch develop
> in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
> 
> 
> The following commit(s) were added to refs/heads/develop by this push:
>     new ea8daaf  fixes finally to layout changes of host class names
> ea8daaf is described below
> 
> commit ea8daaf61e849b0cb4118c0094fd8615ad2c8d3e
> Author: Carlos Rovira <[email protected]>
> AuthorDate: Fri Jun 8 15:37:36 2018 +0200
> 
>    fixes finally to layout changes of host class names
> ---
> .../main/royale/org/apache/royale/jewel/beads/layouts/BasicLayout.as | 5 +++--
> .../royale/org/apache/royale/jewel/beads/layouts/HorizontalLayout.as | 4 +++-
> .../royale/jewel/beads/layouts/HorizontalLayoutSpaceBetween.as       | 5 ++++-
> .../org/apache/royale/jewel/beads/layouts/SimpleHorizontalLayout.as  | 4 +++-
> .../org/apache/royale/jewel/beads/layouts/SimpleVerticalLayout.as    | 4 +++-
> .../main/royale/org/apache/royale/jewel/beads/layouts/TileLayout.as  | 4 +++-
> .../royale/org/apache/royale/jewel/beads/layouts/VerticalLayout.as   | 4 +++-
> 7 files changed, 22 insertions(+), 8 deletions(-)
> 
> diff --git 
> a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/BasicLayout.as
>  
> b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/BasicLayout.as
> index 0633a06..1b01e66 100644
> --- 
> a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/BasicLayout.as
> +++ 
> b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/BasicLayout.as
> @@ -180,8 +180,9 @@ package org.apache.royale.jewel.beads.layouts
>             COMPILE::JS
>             {
>                 var contentView:IParentIUIBase = layoutView as IParentIUIBase;
> -                             (contentView as UIBase).className += " layout 
> absolute";
> -                             
> +                             var c:UIBase = (contentView as UIBase);
> +                             c.element.classList.add("layout");
> +                             c.element.classList.add("absolute");
> 
>                               // without this a state change in a View with 
> BasicLayout will have a wrong behaviour
>                               var children:Array = 
> contentView.internalChildren();
> diff --git 
> a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/HorizontalLayout.as
>  
> b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/HorizontalLayout.as
> index 9e4a656..25441a2 100644
> --- 
> a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/HorizontalLayout.as
> +++ 
> b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/HorizontalLayout.as
> @@ -313,7 +313,9 @@ package org.apache.royale.jewel.beads.layouts
>             COMPILE::JS
>             {
>                 var contentView:IParentIUIBase = layoutView as IParentIUIBase;
> -                             (contentView as UIBase).className += " layout 
> horizontal";
> +                             var c:UIBase = (contentView as UIBase);
> +                             c.element.classList.add("layout");
> +                             c.element.classList.add("horizontal");
> 
>                               var children:Array = 
> contentView.internalChildren();
>                               var i:int;
> diff --git 
> a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/HorizontalLayoutSpaceBetween.as
>  
> b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/HorizontalLayoutSpaceBetween.as
> index 208eaea..cc8525e 100644
> --- 
> a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/HorizontalLayoutSpaceBetween.as
> +++ 
> b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/HorizontalLayoutSpaceBetween.as
> @@ -141,7 +141,10 @@ package org.apache.royale.jewel.beads.layouts
>             COMPILE::JS
>             {
>                               var contentView:IParentIUIBase = layoutView as 
> IParentIUIBase;
> -                             (contentView as UIBase).className += " layout 
> horizontal space";
> +                             var c:UIBase = (contentView as UIBase);
> +                             c.element.classList.add("layout");
> +                             c.element.classList.add("horizontal");
> +                             c.element.classList.add("space");
> 
>                               /** 
>                                *  This Layout uses the following CSS rules
> diff --git 
> a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/SimpleHorizontalLayout.as
>  
> b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/SimpleHorizontalLayout.as
> index 2b7f211..5a8fabd 100644
> --- 
> a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/SimpleHorizontalLayout.as
> +++ 
> b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/SimpleHorizontalLayout.as
> @@ -141,7 +141,9 @@ package org.apache.royale.jewel.beads.layouts
>             COMPILE::JS
>             {
>                               var contentView:IParentIUIBase = layoutView as 
> IParentIUIBase;
> -                             (contentView as UIBase).className += " layout 
> horizontal";
> +                             var c:UIBase = (contentView as UIBase);
> +                             c.element.classList.add("layout");
> +                             c.element.classList.add("horizontal");
> 
>                               /** 
>                                *  This Layout uses the following CSS rules
> diff --git 
> a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/SimpleVerticalLayout.as
>  
> b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/SimpleVerticalLayout.as
> index dcfa414..de6a0b2 100644
> --- 
> a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/SimpleVerticalLayout.as
> +++ 
> b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/SimpleVerticalLayout.as
> @@ -150,7 +150,9 @@ package org.apache.royale.jewel.beads.layouts
>                       COMPILE::JS
>                       {
>                               var contentView:IParentIUIBase = layoutView as 
> IParentIUIBase;
> -                             (contentView as UIBase).className += " layout 
> vertical";
> +                             var c:UIBase = (contentView as UIBase);
> +                             c.element.classList.add("layout");
> +                             c.element.classList.add("vertical");
>                               
>                               var children:Array = 
> contentView.internalChildren();
>                               var i:int;
> diff --git 
> a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/TileLayout.as
>  
> b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/TileLayout.as
> index 9b2f6e9..d39270c 100644
> --- 
> a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/TileLayout.as
> +++ 
> b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/TileLayout.as
> @@ -390,7 +390,9 @@ package org.apache.royale.jewel.beads.layouts
>                       COMPILE::JS
>                       {
>                               var contentView:IParentIUIBase = layoutView as 
> IParentIUIBase;
> -                             (contentView as UIBase).className += " layout 
> tile";
> +                             var c:UIBase = (contentView as UIBase);
> +                             c.element.classList.add("layout");
> +                             c.element.classList.add("tile");
>                               
>                               var children:Array = 
> contentView.internalChildren();
>                               var i:int;
> diff --git 
> a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/VerticalLayout.as
>  
> b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/VerticalLayout.as
> index e5ae419..db62a10 100644
> --- 
> a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/VerticalLayout.as
> +++ 
> b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/VerticalLayout.as
> @@ -317,7 +317,9 @@ package org.apache.royale.jewel.beads.layouts
>                       COMPILE::JS
>                       {
>                               var contentView:IParentIUIBase = layoutView as 
> IParentIUIBase;
> -                             (contentView as UIBase).className += " layout 
> vertical";
> +                             var c:UIBase = (contentView as UIBase);
> +                             c.element.classList.add("layout");
> +                             c.element.classList.add("vertical");
>                               
>                               var children:Array = 
> contentView.internalChildren();
>                               var i:int;
> 
> -- 
> To stop receiving notification emails like this one, please contact
> [email protected].

Reply via email to