royale-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From carlosrov...@apache.org
Subject [royale-asjs] branch develop updated: Fix a bug in IE11 when try to add more than one style with classList.add
Date Sat, 02 Jun 2018 14:56:46 GMT
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 b5c43e3  Fix a bug in IE11 when try to add more than one style with classList.add
b5c43e3 is described below

commit b5c43e3c6f2aaf1857a7ab3908500edd3b187dc5
Author: Carlos Rovira <carlosrovira@apache.org>
AuthorDate: Sat Jun 2 16:56:17 2018 +0200

    Fix a bug in IE11 when try to add more than one style with classList.add
---
 .../royale/org/apache/royale/utils/cssclasslist/addStyles.as  | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/cssclasslist/addStyles.as
b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/cssclasslist/addStyles.as
index c04a8fe..d6f1cab 100644
--- a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/cssclasslist/addStyles.as
+++ b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/cssclasslist/addStyles.as
@@ -41,15 +41,20 @@ package org.apache.royale.utils.cssclasslist
     {
         COMPILE::JS
         {
+            var element:HTMLElement = component.element as HTMLElement;
+
             if (value.indexOf(" ") >= 0)
             {
                 var classes:Array = value.split(" ");
-                var element:HTMLElement = component.element as HTMLElement
-                element.classList.add.apply(element.classList, classes);
+                //element.classList.add.apply(element.classList, classes); // IE11 has a
bug with multiple names
+                for each(var clazz:Object in classes)
+                {
+                    element.classList.add(clazz);
+                }
             } 
             else
             {
-                component.element.classList.add(value);
+                element.classList.add(value);
             }
         }
     }

-- 
To stop receiving notification emails like this one, please contact
carlosrovira@apache.org.

Mime
View raw message