You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by cd...@apache.org on 2016/11/07 07:01:51 UTC
[03/40] git commit: [flex-asjs] [refs/heads/feature/mdl] - MDL Slider
fixes
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/4df65950
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/4df65950
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/4df65950
Branch: refs/heads/feature/mdl
Commit: 4df65950c26a2d16904775984aa20ccc7f25f79c
Parents: 82d8cc0
Author: Carlos Rovira <ca...@apache.org>
Authored: Thu Nov 3 11:00:15 2016 +0100
Committer: Carlos Rovira <ca...@apache.org>
Committed: Sat Nov 5 00:18:33 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/4df65950/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/4df65950/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;
}