flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From carlosrov...@apache.org
Subject git commit: [flex-asjs] [refs/heads/develop] - Added MDL Slider input event and rename valueChange in favor of change
Date Sat, 31 Dec 2016 08:41:31 GMT
Repository: flex-asjs
Updated Branches:
  refs/heads/develop c103c098e -> 858d473f3


Added MDL Slider input event and rename valueChange in favor of change


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

Branch: refs/heads/develop
Commit: 858d473f3baa52eee625dc1e0e4ae1f2fd98ea9d
Parents: c103c09
Author: Carlos Rovira <carlosrovira@apache.org>
Authored: Sat Dec 31 09:41:23 2016 +0100
Committer: Carlos Rovira <carlosrovira@apache.org>
Committed: Sat Dec 31 09:41:23 2016 +0100

----------------------------------------------------------------------
 .../flexjs/MDLExample/src/main/flex/Sliders.mxml    |  4 ++--
 .../src/main/flex/org/apache/flex/mdl/Slider.as     |  4 +++-
 .../mdl/beads/controllers/SliderMouseController.as  | 16 ++++++++++++++--
 3 files changed, 19 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/858d473f/examples/flexjs/MDLExample/src/main/flex/Sliders.mxml
----------------------------------------------------------------------
diff --git a/examples/flexjs/MDLExample/src/main/flex/Sliders.mxml b/examples/flexjs/MDLExample/src/main/flex/Sliders.mxml
index fc9726d..81e3bd4 100644
--- a/examples/flexjs/MDLExample/src/main/flex/Sliders.mxml
+++ b/examples/flexjs/MDLExample/src/main/flex/Sliders.mxml
@@ -56,7 +56,7 @@ limitations under the License.
                     <mdl:CardTitleText id="slider1_txt"/>
                 </mdl:CardTitle>
                 <mdl:CardSupportingText>
-                    <mdl:Slider id="slider1" className="mdlsl_example" valueChange="onValueChange1(event)"/>
+                    <mdl:Slider id="slider1" className="mdlsl_example" change="onValueChange1(event)"
input="onValueChange1(event)"/>
                 </mdl:CardSupportingText>
             </mdl:Card>
 
@@ -65,7 +65,7 @@ limitations under the License.
                     <mdl:CardTitleText id="slider2_txt"/>
                 </mdl:CardTitle>
                 <mdl:CardSupportingText>
-                    <mdl:Slider id="slider2" minimum="0" maximum="10" value="2" stepSize="2"
width="200" valueChange="onValueChange2(event)"/>
+                    <mdl:Slider id="slider2" minimum="0" maximum="10" value="2" stepSize="2"
width="200" change="onValueChange2(event)" input="onValueChange2(event)"/>
                 </mdl:CardSupportingText>
             </mdl:Card>
 

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/858d473f/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Slider.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Slider.as
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Slider.as
index b74a229..b69ac8e 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Slider.as
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Slider.as
@@ -27,7 +27,9 @@ package org.apache.flex.mdl
         import org.apache.flex.core.WrappedHTMLElement;        
     }
 
-	[Event(name="valueChange", type="org.apache.flex.events.Event")]
+	[Event(name="change", type="org.apache.flex.events.Event")]
+
+	[Event(name="input", type="org.apache.flex.events.Event")]
 	
 	/**
 	 *  The Slider class provides a MDL UI-like appearance for a slider.

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/858d473f/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/controllers/SliderMouseController.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/controllers/SliderMouseController.as
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/controllers/SliderMouseController.as
index 876334c..a99f8f7 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/controllers/SliderMouseController.as
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/controllers/SliderMouseController.as
@@ -97,7 +97,7 @@ package org.apache.flex.mdl.beads.controllers
                 //goog.events.listen(thumb.element, goog.events.EventType.MOUSEDOWN, handleThumbDown,
false, this);
 
                 goog.events.listen(UIBase(_strand).element, "change", handleChange, false,
this);
-                //goog.events.listen(UIBase(_strand).element, "oninput", handleTrackClick,
false, this);
+                goog.events.listen(UIBase(_strand).element, "input", handleInput, false,
this);
             }
 		}
 
@@ -110,7 +110,19 @@ package org.apache.flex.mdl.beads.controllers
 
             rangeModel.value = Number((UIBase(_strand).element as HTMLInputElement).value);
 
-            host.dispatchEvent(new org.apache.flex.events.Event('valueChange'));
+            host.dispatchEvent(new org.apache.flex.events.Event('change'));
+        }
+
+        /**
+         */
+        COMPILE::JS
+        private function handleInput(event:BrowserEvent):void
+        {
+            var host:Slider = _strand as Slider;
+
+            rangeModel.value = Number((UIBase(_strand).element as HTMLInputElement).value);
+
+            host.dispatchEvent(new org.apache.flex.events.Event('input'));
         }
 		
         COMPILE::SWF


Mime
View raw message