You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by pi...@apache.org on 2018/04/29 17:49:07 UTC

[royale-asjs] branch develop updated: NavigationLayout: Using ClassSelectorList to handle changes of className

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

piotrz 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 68639a5  NavigationLayout: Using ClassSelectorList to handle changes of className
68639a5 is described below

commit 68639a5b2d791ab1f74e70ca69621ef55dead7cd
Author: Piotr Zarzycki <pi...@gmail.com>
AuthorDate: Sun Apr 29 19:48:56 2018 +0200

    NavigationLayout: Using ClassSelectorList to handle changes of className
---
 .../org/apache/royale/mdl/NavigationLayout.as      | 30 +++++-----------------
 1 file changed, 7 insertions(+), 23 deletions(-)

diff --git a/frameworks/projects/MaterialDesignLite/src/main/royale/org/apache/royale/mdl/NavigationLayout.as b/frameworks/projects/MaterialDesignLite/src/main/royale/org/apache/royale/mdl/NavigationLayout.as
index a469ea6..316a79b 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/royale/org/apache/royale/mdl/NavigationLayout.as
+++ b/frameworks/projects/MaterialDesignLite/src/main/royale/org/apache/royale/mdl/NavigationLayout.as
@@ -21,12 +21,11 @@ package org.apache.royale.mdl
 	import org.apache.royale.core.IApplicationView;
 	import org.apache.royale.events.Event;
 	import org.apache.royale.html.Group;
+    import org.apache.royale.utils.ClassSelectorList;
 
     COMPILE::JS
     {
         import org.apache.royale.core.WrappedHTMLElement;
-		import org.apache.royale.html.util.addElementToWrapper;
-        import org.apache.royale.core.CSSClassList;
     }
 
 	/**
@@ -53,16 +52,11 @@ package org.apache.royale.mdl
 		{
 			super();
 
-            COMPILE::JS
-            {
-                _classList = new CSSClassList();
-            }
-
+            classSelectorList = new ClassSelectorList(this);
             typeNames = "mdl-layout mdl-js-layout";
 		}
 
-        COMPILE::JS
-        private var _classList:CSSClassList;
+        protected var classSelectorList:ClassSelectorList;
 
 		private var _applicationModel:Object;
 
@@ -112,12 +106,7 @@ package org.apache.royale.mdl
             {
                 _fixedHeader = value;
 
-                COMPILE::JS
-                {
-                    var classVal:String = "mdl-layout--fixed-header";
-                    value ? _classList.add(classVal) : _classList.remove(classVal);
-                    setClassName(computeFinalClassNames());
-                }
+                classSelectorList.toggle("mdl-layout--fixed-header", value);
             }
         }
 
@@ -142,19 +131,14 @@ package org.apache.royale.mdl
             {
                 _fixedDrawer = value;
 
-                COMPILE::JS
-                {
-                    var classVal:String = "mdl-layout--fixed-drawer";
-                    value ? _classList.add(classVal) : _classList.remove(classVal);
-                    setClassName(computeFinalClassNames());
-                }
+                classSelectorList.toggle("mdl-layout--fixed-drawer", value);
             }
         }
 
         COMPILE::JS
-        override protected function computeFinalClassNames():String
+        override protected function setClassName(value:String):void
         {
-            return _classList.compute() + super.computeFinalClassNames();
+            classSelectorList.addNames(value);
         }
 	}
 }

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