flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From carlosrov...@apache.org
Subject [19/37] git commit: [flex-asjs] [refs/heads/feature/mdl] - MDL Slider fixes
Date Fri, 04 Nov 2016 16:44:38 GMT
MDL Slider fixes


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

Branch: refs/heads/feature/mdl
Commit: 1dd10d167ee7f2dfefa8d99c5c568503bb3b2427
Parents: 156337a
Author: Carlos Rovira <carlosrovira@apache.org>
Authored: Thu Nov 3 11:00:15 2016 +0100
Committer: Carlos Rovira <carlosrovira@apache.org>
Committed: Fri Nov 4 17:43:37 2016 +0100

----------------------------------------------------------------------
 .../flexjs/MDLExample/src/main/flex/App.mxml    |  4 ++-
 .../src/main/flex/org/apache/flex/mdl/Slider.as | 37 +++++++++++---------
 2 files changed, 24 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1dd10d16/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 dca2da1..8487f5b 100644
--- a/examples/flexjs/MDLExample/src/main/flex/App.mxml
+++ b/examples/flexjs/MDLExample/src/main/flex/App.mxml
@@ -102,7 +102,9 @@ limitations under the License.
                 </mdl:RadioButton>
                 <mdl:RadioButton groupName="g1" text="Red"/>
 
-                <mdl:Slider minimum="0" maximum="100" value="0"/>
+                <mdl:Slider/>
+
+                <mdl:Slider minimum="0" maximum="10" value="2" stepSize="2" width="200"/>
 
             </js:Form>
 

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1dd10d16/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 2587227..31267ad 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
@@ -87,7 +87,7 @@ package org.apache.flex.mdl
 
 			COMPILE::JS
 			{
-				(element as HTMLInputElement).value = "" + value;
+				(element as HTMLInputElement).value = IRangeModel(model).value.toString();
 			}
 		}
 		
@@ -109,7 +109,7 @@ package org.apache.flex.mdl
 
 			COMPILE::JS
 			{
-				(element as HTMLInputElement).min = "" + value;
+				(element as HTMLInputElement).min = IRangeModel(model).minimum.toString();
 			}
 		}
 		
@@ -131,7 +131,7 @@ package org.apache.flex.mdl
 
 			COMPILE::JS
 			{
-				(element as HTMLInputElement).max = "" + value;
+				(element as HTMLInputElement).max = IRangeModel(model).maximum.toString();
 			}
 			
 		}
@@ -170,6 +170,11 @@ package org.apache.flex.mdl
         public function set stepSize(value:Number):void
         {
             IRangeModel(model).stepSize = value;
+
+			COMPILE::JS
+			{
+				(element as HTMLInputElement).step = IRangeModel(model).stepSize.toString();
+			}
         }
 
         COMPILE::JS
@@ -191,33 +196,33 @@ package org.apache.flex.mdl
         COMPILE::JS
         override protected function createElement():WrappedHTMLElement
         {
-            input = document.createElement('input') as HTMLInputElement;
-			input.type = "range";
-			//input.min = "0";
-			//input.max = "100";
-			//input.value = "0";
+			var p:HTMLElement = document.createElement('p') as HTMLElement;
+            p.style.width = '300px';
 
+			input = document.createElement('input') as HTMLInputElement;
+			input.type = "range";
+			input.value = IRangeModel(model).value.toString();
+			input.min = IRangeModel(model).minimum.toString();
+			input.max = IRangeModel(model).maximum.toString();
+			input.step = IRangeModel(model).stepSize.toString();
+			input.className = 'mdl-slider mdl-js-slider';
 
-            //input.style.width = '200px';
-            //input.style.height = '30px';
+			p.appendChild(input);
 
 			element = input as WrappedHTMLElement;
             
             //track = new SliderTrackView();
-            //addBead(track);
-            
+            //addBead(track);            
             //thumb = new SliderThumbView();
             //addBead(thumb);
-            
             //controller = new SliderMouseController();
             //addBead(controller);
             
-            positioner = element;
+            positioner = p as WrappedHTMLElement;
             positioner.style.position = 'relative';
+			(input as WrappedHTMLElement).flexjs_wrapper = this;
             element.flexjs_wrapper = this;
             
-            className = typeNames = 'mdl-slider mdl-js-slider';
-            
             return element;
         } 
         


Mime
View raw message