Made label nonselectable by default (does not work in IE 10 or lower)
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/580ededb Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/580ededb Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/580ededb Branch: refs/heads/develop Commit: 580ededbd9283a77b672f4b25c45378e075b822d Parents: 26606c8 Author: Harbs <ha...@in-tools.com> Authored: Mon Jul 25 10:39:09 2016 +0300 Committer: Harbs <ha...@in-tools.com> Committed: Mon Jul 25 10:39:09 2016 +0300 ---------------------------------------------------------------------- .../src/main/flex/org/apache/flex/html/Label.as | 27 ++++++++++++++++++++ manualtests/FlexJSTest_SVG/src/SkinsView.mxml | 4 +-- 2 files changed, 29 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/580ededb/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Label.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Label.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Label.as index b811ec5..21282f8 100644 --- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Label.as +++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Label.as @@ -134,6 +134,28 @@ package org.apache.flex.html this.dispatchEvent('textChange'); } } + private var _selectable:Boolean; + + public function get selectable():Boolean + { + return _selectable; + } + public function set selectable(value:Boolean):void + { + if(value != _selectable) + { + _selectable = value; + COMPILE::JS + { + if(element) + { + element.style.cursor = _selectable ? "auto" : "default"; + element.style.pointerEvents = _selectable ? "auto" : "none"; + } + } + } + + } /** @@ -157,6 +179,11 @@ package org.apache.flex.html positioner = element; element.flexjs_wrapper = this; element.style.whiteSpace = "nowrap"; + if(!selectable) + { + element.style.cursor = "default"; + element.style.pointerEvents = "none"; + } className = "Label"; typeNames = "Label"; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/580ededb/manualtests/FlexJSTest_SVG/src/SkinsView.mxml ---------------------------------------------------------------------- diff --git a/manualtests/FlexJSTest_SVG/src/SkinsView.mxml b/manualtests/FlexJSTest_SVG/src/SkinsView.mxml index 9140b31..e1a95d3 100644 --- a/manualtests/FlexJSTest_SVG/src/SkinsView.mxml +++ b/manualtests/FlexJSTest_SVG/src/SkinsView.mxml @@ -72,7 +72,7 @@ limitations under the License. <js:ViewDataBinding /> </js:beads>--> <js:Container x="0" y="0" > - <js:Label text="MyButton" x="20" y="5" includeIn="{[up,down,over,disabled]}" /> + <js:Label text="MyButton" x="20" y="10" includeIn="{[up,down,over,disabled]}" selectable="true"/> <js:Rect id="fill_up" width="100" height="30" includeIn="up" > <js:stroke> @@ -100,7 +100,7 @@ limitations under the License. <js:SolidColor color="#16A085" alpha="1.0" /> </js:fill> </js:Rect> - + <js:TextButton x="50" y="100" text="Just a button"/> </js:Container> </js:View>