You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ca...@apache.org on 2016/11/04 16:44:48 UTC

[29/37] git commit: [flex-asjs] [refs/heads/feature/mdl] - Minor changes

Minor changes


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/04cc31ef
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/04cc31ef
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/04cc31ef

Branch: refs/heads/feature/mdl
Commit: 04cc31ef6044d6f7b17d328e82ad4085f6b644ad
Parents: 8db1d9e
Author: Carlos Rovira <ca...@apache.org>
Authored: Thu Oct 27 18:28:34 2016 +0200
Committer: Carlos Rovira <ca...@apache.org>
Committed: Fri Nov 4 17:43:37 2016 +0100

----------------------------------------------------------------------
 examples/flexjs/MDLExample/pom.xml              |  6 ++
 .../flexjs/MDLExample/src/main/flex/App.mxml    |  6 +-
 .../src/main/resources/mdl-styles.css           | 20 ++---
 .../main/flex/org/apache/flex/mdl/CheckBox.as   | 85 ++++++--------------
 .../flex/org/apache/flex/mdl/beads/Disabled.as  | 20 ++++-
 .../src/main/resources/defaults.css             |  7 +-
 6 files changed, 66 insertions(+), 78 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/04cc31ef/examples/flexjs/MDLExample/pom.xml
----------------------------------------------------------------------
diff --git a/examples/flexjs/MDLExample/pom.xml b/examples/flexjs/MDLExample/pom.xml
index 3a31b25..1503b57 100644
--- a/examples/flexjs/MDLExample/pom.xml
+++ b/examples/flexjs/MDLExample/pom.xml
@@ -44,6 +44,12 @@
         <configuration>
           <flashVersion>20.0</flashVersion>
           <mainClass>App.mxml</mainClass>
+          <includeFiles>
+            <include-file>
+              <name>defaults.css</name>
+              <path>../src/main/resources/defaults.css</path>
+            </include-file>
+          </includeFiles>
         </configuration>
         <executions>
           <!-- Add a second execution with output set to JavaScript (Flash is the default) -->

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/04cc31ef/examples/flexjs/MDLExample/src/main/flex/App.mxml
----------------------------------------------------------------------
diff --git a/examples/flexjs/MDLExample/src/main/flex/App.mxml b/examples/flexjs/MDLExample/src/main/flex/App.mxml
index 472f556..9f76732 100644
--- a/examples/flexjs/MDLExample/src/main/flex/App.mxml
+++ b/examples/flexjs/MDLExample/src/main/flex/App.mxml
@@ -53,20 +53,20 @@ limitations under the License.
                     </mdl:Button>
 
                     <!-- Raised button -->
-                    <mdl:Button text="BUTTON">
+                    <mdl:Button text="COLORED">
                         <js:beads>
                             <mdl:ButtonEffect raised="true" colored="true"/>
                         </js:beads>
                     </mdl:Button>
 
                     <!-- Raised button with ripple -->
-                    <mdl:Button text="BUTTON">
+                    <mdl:Button text="ACCENT">
                         <js:beads>
                             <mdl:ButtonEffect raised="true" ripple="true" accent="true"/>
                         </js:beads>
                     </mdl:Button>
                     <!-- Raised disabled button-->
-                    <mdl:Button text="BUTTON">
+                    <mdl:Button text="DISABLED">
                         <js:beads>
                             <mdl:ButtonEffect raised="true"/>
                             <mdl:Disabled/>

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/04cc31ef/examples/flexjs/MDLExample/src/main/resources/mdl-styles.css
----------------------------------------------------------------------
diff --git a/examples/flexjs/MDLExample/src/main/resources/mdl-styles.css b/examples/flexjs/MDLExample/src/main/resources/mdl-styles.css
index 6a07905..3da8515 100644
--- a/examples/flexjs/MDLExample/src/main/resources/mdl-styles.css
+++ b/examples/flexjs/MDLExample/src/main/resources/mdl-styles.css
@@ -19,14 +19,16 @@
 ////////////////////////////////////////////////////////////////////////////////
 */
 
-.demo-card-wide.mdl-card {
-  width: 512px;
+@namespace "library://ns.apache.org/flexjs/basic";
+
+.flexjs *, . flexjs *:before, . flexjs *:after {
+    -moz-box-sizing: border-box;
+    -webkit-box-sizing: border-box;
+    box-sizing: border-box;
 }
-.demo-card-wide > .mdl-card__title {
-  color: #fff;
-  height: 176px;
-  background: url('welcome_card.jpg') center / cover;
+
+Application
+{
+	padding: 10px;
+	margin: 10px;
 }
-.demo-card-wide > .mdl-card__menu {
-  color: #fff;
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/04cc31ef/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/CheckBox.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/CheckBox.as b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/CheckBox.as
index 4f2bf9e..a4d2a4c 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/CheckBox.as
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/CheckBox.as
@@ -73,64 +73,31 @@ package org.apache.flex.mdl
          */
         override protected function createElement():WrappedHTMLElement
         {
-                label = document.createElement('label') as HTMLLabelElement;
-                element = label as WrappedHTMLElement;
-                
-                input = document.createElement('input') as HTMLInputElement;
-                input.type = 'checkbox';
-                input.className = 'mdl-checkbox__input';
-                //input.addEventListener('change', selectionChangeHandler, false);
-                label.appendChild(input);
-                
-                checkbox = document.createElement('span') as HTMLSpanElement;
-                checkbox.className = 'mdl-checkbox__label';
-                //checkbox.addEventListener('mouseover', mouseOverHandler, false);
-                //checkbox.addEventListener('mouseout', mouseOutHandler, false);
-                label.appendChild(checkbox);
-                
-                textNode = document.createTextNode('') as Text;
-                checkbox.appendChild(textNode);
-                
-                positioner = element;
-                positioner.style.position = 'relative';
-                (input as WrappedHTMLElement).flexjs_wrapper = this;
-                (checkbox as WrappedHTMLElement).flexjs_wrapper = this;
-                element.flexjs_wrapper = this;
-                
-                className = typeNames = 'mdl-checkbox mdl-js-checkbox';
+            label = document.createElement('label') as HTMLLabelElement;
+            element = label as WrappedHTMLElement;
+            
+            input = document.createElement('input') as HTMLInputElement;
+            input.type = 'checkbox';    
+            input.className = 'mdl-checkbox__input';
+            label.appendChild(input);
+            
+            checkbox = document.createElement('span') as HTMLSpanElement;
+            checkbox.className = 'mdl-checkbox__label';
+            label.appendChild(checkbox);
+            
+            textNode = document.createTextNode('') as Text;
+            checkbox.appendChild(textNode);
+            
+            positioner = element;
+            positioner.style.position = 'relative';
+            (input as WrappedHTMLElement).flexjs_wrapper = this;
+            (checkbox as WrappedHTMLElement).flexjs_wrapper = this;
+            element.flexjs_wrapper = this;
+            
+            className = typeNames = 'mdl-checkbox mdl-js-checkbox';
 
-                return element;
-            };
-        
-        
-        /**
-         */
-        private function mouseOverHandler(event:Event):void
-        {
-            //checkbox.className = 'checkbox-icon-hover';
-        }
-        
-        /**
-         */
-        private function mouseOutHandler(event:Event):void
-        {
-            /*if (input.checked)
-                checkbox.className = 'checkbox-icon-checked';
-            else
-                checkbox.className = 'checkbox-icon';*/
-        }
-        
-        
-        /**
-         */
-        private function selectionChangeHandler(event:Event):void
-        {
-            /*if (input.checked)
-                checkbox.className = 'checkbox-icon-checked';
-            else
-                checkbox.className = 'checkbox-icon';*/
-        }
-        
+            return element;
+        };
         
         public function get text():String
         {
@@ -150,10 +117,6 @@ package org.apache.flex.mdl
         public function set selected(value:Boolean):void
         {
             input.checked = value;
-            /*if (value)
-                checkbox.className = 'checkbox-icon-checked';
-            else
-                checkbox.className = 'checkbox-icon';*/
         }
     }
 

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/04cc31ef/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/Disabled.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/Disabled.as b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/Disabled.as
index 46067ff..fcec373 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/Disabled.as
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/Disabled.as
@@ -46,6 +46,24 @@ package org.apache.flex.mdl.beads
 		{
 		}
 		
+		private var _disabled:Boolean = true;
+        /**
+		 *  A boolean flag to enable or disable the host control.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+        public function get disabled():Boolean
+        {
+            return _disabled;
+        }
+        public function set disabled(value:Boolean):void
+        {
+            _disabled = value; 
+        }
+
 		private var _strand:IStrand;
 		
 		/**
@@ -69,7 +87,7 @@ package org.apache.flex.mdl.beads
                 //if (host.element is HTMLInputElement)
                 //{
                     input = host.element as HTMLInputElement;
-                    input.disabled = "disabled";
+                    //input.disabled = _disabled ? "disabled" : "";
                 //} else
                 //{
                  //   throw new Error("Host element component in not type input");

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/04cc31ef/frameworks/projects/MaterialDesignLite/src/main/resources/defaults.css
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/resources/defaults.css b/frameworks/projects/MaterialDesignLite/src/main/resources/defaults.css
index ae61dc6..8e538a1 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/resources/defaults.css
+++ b/frameworks/projects/MaterialDesignLite/src/main/resources/defaults.css
@@ -21,10 +21,9 @@
 @namespace "library://ns.apache.org/flexjs/basic";
 @namespace mdl "library://ns.apache.org/flexjs/mdl";
 
-.flexjs *, . flexjs *:before, . flexjs *:after {
-    -moz-box-sizing: border-box;
-    -webkit-box-sizing: border-box;
-    box-sizing: border-box;
+mdl|CheckBox
+{
+    IBeadModel: ClassReference("org.apache.flex.html.beads.models.ToggleButtonModel");			
 }