flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject [21/28] git commit: [flex-asjs] [refs/heads/feature/dragAndDrop] - Added change event on CheckBox Fixed RadioButton too
Date Mon, 21 Aug 2017 09:12:16 GMT
Added change event on CheckBox
Fixed RadioButton too


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

Branch: refs/heads/feature/dragAndDrop
Commit: 1d4211c4cb0200b2c8bae172adef6f9575ff553f
Parents: 89145f1
Author: Harbs <harbs@in-tools.com>
Authored: Fri Aug 18 15:46:25 2017 +0300
Committer: Harbs <harbs@in-tools.com>
Committed: Fri Aug 18 15:46:25 2017 +0300

----------------------------------------------------------------------
 .../src/main/flex/org/apache/flex/mdl/CheckBox.as    |  3 +++
 .../src/main/flex/org/apache/flex/mdl/RadioButton.as | 15 +++++++++++++--
 2 files changed, 16 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1d4211c4/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 58966f5..25d6846 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
@@ -245,6 +245,8 @@ package org.apache.flex.mdl
 
             COMPILE::JS
 			{
+                if(input.checked == value)
+                    return;
                 var instance:Object = element['MaterialCheckbox'];
                 if(instance)
                 {
@@ -255,6 +257,7 @@ package org.apache.flex.mdl
                 }
                 else
                     input.checked = value;
+                dispatchEvent(new Event(Event.CHANGE));
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1d4211c4/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/RadioButton.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/RadioButton.as
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/RadioButton.as
index f07a048..1b93392 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/RadioButton.as
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/RadioButton.as
@@ -417,8 +417,19 @@ package org.apache.flex.mdl
         }
         public function set selected(value:Boolean):void
         {
-            icon.checked = value;
-            dispatchEvent(new Event(Event.CHANGE))
+            if(icon.checked == value)
+                return;
+            var instance:Object = element['MaterialRadio'];
+            if(instance)
+            {
+                if(value)
+                    instance["check"]();
+                else
+                    instance["uncheck"]();
+            }
+            else
+                icon.checked = value;
+            dispatchEvent(new Event(Event.CHANGE));
         }
         
         public function get value():Object


Mime
View raw message