flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject [18/28] git commit: [flex-asjs] [refs/heads/feature/dragAndDrop] - Setting checked state manually now works
Date Mon, 21 Aug 2017 09:12:13 GMT
Setting checked state manually now works


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

Branch: refs/heads/feature/dragAndDrop
Commit: 467d4bfdba723eab442e5f8c12ddc816c7f8bb9f
Parents: f208da8
Author: Harbs <harbs@in-tools.com>
Authored: Fri Aug 18 15:01:23 2017 +0300
Committer: Harbs <harbs@in-tools.com>
Committed: Fri Aug 18 15:01:23 2017 +0300

----------------------------------------------------------------------
 .../main/flex/org/apache/flex/mdl/CheckBox.as   | 49 +++++++++++++++++---
 .../src/main/resources/defaults.css             | 10 ++--
 2 files changed, 47 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/467d4bfd/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 aeafe00..84afae8 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
@@ -143,7 +143,14 @@ package org.apache.flex.mdl
          */
 		override public function get text():String
 		{
-			return IToggleButtonModel(model).text;
+            COMPILE::SWF
+            {
+    			return IToggleButtonModel(model).text;
+            }
+            COMPILE::JS
+            {
+                return textNode ? textNode.nodeValue : "";
+            }
 		}
 
         /**
@@ -151,11 +158,14 @@ package org.apache.flex.mdl
          */
         override public function set text(value:String):void
 		{
-            IToggleButtonModel(model).text = value;
+            COMPILE::SWF
+            {
+                IToggleButtonModel(model).text = value;
+            }
 
             COMPILE::JS
 			{
-                if(textNode == null)
+                if(!textNode)
                 {
                     textNode = document.createTextNode('') as Text;
                     checkbox.appendChild(textNode);
@@ -175,11 +185,22 @@ package org.apache.flex.mdl
          */
         public function get value():String
         {
-            return IToggleButtonModel(model).html;
+            COMPILE::SWF
+            {
+                return IToggleButtonModel(model).html;
+            }
+
+            COMPILE::JS
+            {
+                return input.value;
+            }
         }
         public function set value(newValue:String):void
         {
-            IToggleButtonModel(model).html = newValue;
+            COMPILE::SWF
+            {
+                IToggleButtonModel(model).html = newValue;
+            }
 
             COMPILE::JS
             {
@@ -202,7 +223,14 @@ package org.apache.flex.mdl
          */
 		override public function get selected():Boolean
 		{
-			return IToggleButtonModel(model).selected;
+            COMPILE::SWF
+            {
+    			return IToggleButtonModel(model).selected;
+            }
+            COMPILE::JS
+            {
+                return input.checked;
+            }
 		}
 
         /**
@@ -210,11 +238,18 @@ package org.apache.flex.mdl
          */
         override public function set selected(value:Boolean):void
         {
-            IToggleButtonModel(model).selected = value;
+            COMPILE::SWF
+            {
+                IToggleButtonModel(model).selected = value;
+            }
 
             COMPILE::JS
 			{
                 input.checked = value;
+                if(value)
+                    element['MaterialCheckbox'].check();
+                else
+                    element['MaterialCheckbox'].uncheck();
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/467d4bfd/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 096f442..f8b3b05 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/resources/defaults.css
+++ b/frameworks/projects/MaterialDesignLite/src/main/resources/defaults.css
@@ -54,11 +54,6 @@ TextArea
     IBeadController: ClassReference("org.apache.flex.html.beads.controllers.EditableTextKeyboardController");*/
 }
 
-CheckBox
-{
-    IBeadModel: ClassReference("org.apache.flex.html.beads.models.ToggleButtonModel");		

-}
-
 IconToggle
 {
     IBeadModel: ClassReference("org.apache.flex.html.beads.models.ToggleButtonModel");		

@@ -170,6 +165,11 @@ DropDownList
 
 @media -flex-flash
 {
+    CheckBox
+    {
+        IBeadModel: ClassReference("org.apache.flex.html.beads.models.ToggleButtonModel");
		
+    }
+    
     Slider
     {
         iThumbView: ClassReference("org.apache.flex.mdl.beads.views.SliderThumbView");


Mime
View raw message