Repository: flex-asjs Updated Branches: refs/heads/feature/FLEX-35328_simplify_mdl_drop_down_list 2fc506e62 -> 69139d976
FLEX-35328 - Add prompt property to MDL DropDownList - it displays text if nothing is selected Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/69139d97 Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/69139d97 Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/69139d97 Branch: refs/heads/feature/FLEX-35328_simplify_mdl_drop_down_list Commit: 69139d976fdfe282f8ee503b10f1c3d848fa7919 Parents: 2fc506e Author: piotrz <pio...@apache.org> Authored: Sat Jun 24 19:29:46 2017 +0200 Committer: piotrz <pio...@apache.org> Committed: Sat Jun 24 19:29:46 2017 +0200 ---------------------------------------------------------------------- .../flex/org/apache/flex/mdl/DropDownList.as | 23 ++++++++++++++++++-- .../flex/mdl/beads/views/DropDownListView.as | 3 ++- 2 files changed, 23 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/69139d97/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/DropDownList.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/DropDownList.as b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/DropDownList.as index 2dddaf3..708b8ba 100644 --- a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/DropDownList.as +++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/DropDownList.as @@ -23,7 +23,6 @@ package org.apache.flex.mdl import org.apache.flex.core.UIBase; import org.apache.flex.events.ItemAddedEvent; import org.apache.flex.html.DataContainer; - import org.apache.flex.html.Option; import org.apache.flex.html.Select; COMPILE::JS @@ -56,13 +55,33 @@ package org.apache.flex.mdl * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 + * @productversion FlexJS 0.8 */ public function DropDownList() { super(); } + private var _prompt:String; + + /** + * The prompt for the DropDownList control. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.9 + */ + public function get prompt():String + { + return _prompt; + } + + public function set prompt(value:String):void + { + _prompt = value; + } + protected var _dropDown:Select; public function get dropDown():Select http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/69139d97/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/views/DropDownListView.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/views/DropDownListView.as b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/views/DropDownListView.as index cad3e0d..de2d1a0 100644 --- a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/views/DropDownListView.as +++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/views/DropDownListView.as @@ -47,7 +47,7 @@ package org.apache.flex.mdl.beads.views * @copy org.apache.flex.core.IBead#strand * * @flexjsignorecoercion HTMLLabelElement - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 @@ -62,6 +62,7 @@ package org.apache.flex.mdl.beads.views var dropDownList:DropDownList = (value as DropDownList); dropDownList.labelDisplay = document.createElement('label') as HTMLLabelElement; + dropDownList.labelDisplay.innerText = dropDownList.prompt; dropDownList.labelDisplay.classList.add("mdl-textfield__label"); dropDownList.dropDown = new Select();