This is an automated email from the ASF dual-hosted git repository.

piotrz pushed a commit to branch feature/type_names_class_name_issue124
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 9057833ee2557179a5e396b7a53856f63ab368d1
Author: Piotr Zarzycki <[email protected]>
AuthorDate: Thu Mar 1 22:50:59 2018 +0100

    Add computeFinalClassNames function which concatenates _className with 
typeNames (reference #124)
---
 .../src/main/royale/org/apache/royale/core/UIBase.as      | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git 
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/UIBase.as 
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/UIBase.as
index 66f06f9..928c831 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/UIBase.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/UIBase.as
@@ -1058,13 +1058,19 @@ package org.apache.royale.core
                 dispatchEvent(new Event("classNameChanged"));
             }
         }
-        
+
+               COMPILE::JS
+        protected function computeFinalClassNames():String
+               {
+            return (_className ? _className + " " : "") + 
StringUtil.trim(typeNames ? typeNames : "");
+               }
+
         COMPILE::JS
         protected function setClassName(value:String):void
         {
             element.className = value;           
         }
-        
+
         /**
          *  @copy org.apache.royale.core.IUIBase#element
          *  
@@ -1352,7 +1358,10 @@ package org.apache.royale.core
             COMPILE::JS
             {
                                if (typeNames)
-                                       setClassName((_className ? _className + 
" " : "") + typeNames);
+                {
+                    setClassName(computeFinalClassNames());
+                }
+
                 if (style)
                     ValuesManager.valuesImpl.applyStyles(this, style);
             }

-- 
To stop receiving notification emails like this one, please contact
[email protected].

Reply via email to