flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From carlosrov...@apache.org
Subject flex-asjs git commit: Override addEventListener for click in MDL RB, close, but now MDLExample doesn’t throw click
Date Thu, 02 Feb 2017 23:19:05 GMT
Repository: flex-asjs
Updated Branches:
  refs/heads/develop 353eb4826 -> 69500f90e


Override addEventListener for click in MDL RB, close, but now MDLExample doesn’t throw click


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

Branch: refs/heads/develop
Commit: 69500f90e643b207607f5f04b091df4926e036b3
Parents: 353eb48
Author: Carlos Rovira <carlosrovira@apache.org>
Authored: Fri Feb 3 00:18:58 2017 +0100
Committer: Carlos Rovira <carlosrovira@apache.org>
Committed: Fri Feb 3 00:18:58 2017 +0100

----------------------------------------------------------------------
 .../flex/org/apache/flex/mdl/RadioButton.as     | 26 +++++++++++++++-----
 1 file changed, 20 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/69500f90/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 52ae1fd..4eb24de 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
@@ -313,7 +313,7 @@ package org.apache.flex.mdl
             label.appendChild(icon);
             label.appendChild(radio);
 
-            label.addEventListener("click", clickHandler, false);
+            //label.addEventListener("click", clickHandler, false);
             
             element = label as WrappedHTMLElement;
             
@@ -327,12 +327,25 @@ package org.apache.flex.mdl
         };
 
         COMPILE::JS
+        override public function addEventListener(type:String, handler:Function, opt_capture:Boolean
= false, opt_handlerScope:Object = null):void
+        {
+            if (type == "click")
+            {
+                icon.addEventListener("click", clickHandler, false);
+            }
+            else
+            {
+               super.addEventListener(type, handler);
+            }
+        }
+
+        COMPILE::JS
         public function clickHandler(event:Event):void
         {
-            event.preventDefault();
-            unselectAll();
+            //event.preventDefault();
+            //unselectAll();
             selected = !selected;
-            element.classList.toggle("is-checked", selected);
+            //element.classList.toggle("is-checked", selected);
         }
 
         protected var _ripple:Boolean = false;
@@ -434,7 +447,7 @@ package org.apache.flex.mdl
             }
         }
 
-        COMPILE::JS
+        /*COMPILE::JS
         private function unselectAll():void
         {
             var groupName:String = icon.name as String;
@@ -455,7 +468,8 @@ package org.apache.flex.mdl
                     lbl.classList.remove("is-checked");
                 }
             }
-        }
+        }*/
+
         /**
          * @param e The event object.
          */


Mime
View raw message