You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ha...@apache.org on 2017/02/21 08:40:43 UTC
[1/2] flex-asjs git commit: Fixed ImageButton It’s now a button instead of an input as input was causing lots of issues
Repository: flex-asjs
Updated Branches:
refs/heads/develop 74ea47cbc -> 36151f71c
Fixed ImageButton
It\u2019s now a button instead of an input as input was causing lots of issues
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/f14d6a09
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/f14d6a09
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/f14d6a09
Branch: refs/heads/develop
Commit: f14d6a0996e7b768186feeff4642641e0a14beba
Parents: 6f30fb2
Author: Harbs <ha...@in-tools.com>
Authored: Tue Feb 21 10:39:22 2017 +0200
Committer: Harbs <ha...@in-tools.com>
Committed: Tue Feb 21 10:39:22 2017 +0200
----------------------------------------------------------------------
.../flex/org/apache/flex/html/ImageButton.as | 45 +++++++++++---------
.../HTML/src/main/resources/defaults.css | 1 +
2 files changed, 27 insertions(+), 19 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f14d6a09/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/ImageButton.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/ImageButton.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/ImageButton.as
index e5fc54c..5912a84 100644
--- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/ImageButton.as
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/ImageButton.as
@@ -20,6 +20,7 @@ package org.apache.flex.html
{
import org.apache.flex.core.SimpleCSSStyles;
import org.apache.flex.events.Event;
+ import org.apache.flex.html.beads.models.ImageModel;
COMPILE::JS
{
@@ -55,18 +56,17 @@ package org.apache.flex.html
* @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
*/
COMPILE::JS
- override protected function createElement():WrappedHTMLElement
- {
- element = document.createElement("input") as WrappedHTMLElement;
- positioner = element;
- element.flexjs_wrapper = this;
-
- var inputElement:HTMLInputElement = element as HTMLInputElement;
- inputElement.type = "image";
- inputElement.setAttribute("value", " ");
-
- return element;
- }
+ override protected function createElement():WrappedHTMLElement
+ {
+ element = document.createElement('button') as WrappedHTMLElement;
+ element.setAttribute('type', 'button');
+
+ positioner = element;
+ positioner.style.position = 'relative';
+ element.flexjs_wrapper = this;
+
+ return element;
+ }
[Bindable("srcChanged")]
/**
@@ -76,18 +76,25 @@ package org.apache.flex.html
*/
public function get src():String
{
- return style.backgroundImage;
+ return ImageModel(model).url;
}
public function set src(url:String):void
{
- if (!style)
- style = new SimpleCSSStyles();
- style.backgroundImage = url;
+ ImageModel(model).url = url;
+ COMPILE::SWF
+ {
+ if (!style)
+ style = new SimpleCSSStyles();
+ style.backgroundImage = url;
+ }
- COMPILE::JS {
- var inputElement:HTMLInputElement = element as HTMLInputElement;
- inputElement.src = url;
+ COMPILE::JS
+ {
+ var inner:String = '';
+ if (url)
+ inner = "<img src='" + url + "'/>";
+ element.innerHTML = inner;
}
dispatchEvent(new Event("srcChanged"));
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f14d6a09/frameworks/projects/HTML/src/main/resources/defaults.css
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/resources/defaults.css b/frameworks/projects/HTML/src/main/resources/defaults.css
index 4eb6de6..8abe5ee 100644
--- a/frameworks/projects/HTML/src/main/resources/defaults.css
+++ b/frameworks/projects/HTML/src/main/resources/defaults.css
@@ -291,6 +291,7 @@ ImageAndTextButton
ImageButton
{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.ImageModel");
border-style: none;
}
[2/2] git commit: [flex-asjs] [refs/heads/develop] - Merge branch
'develop' of https://git-wip-us.apache.org/repos/asf/flex-asjs into develop
Posted by ha...@apache.org.
Merge branch 'develop' of https://git-wip-us.apache.org/repos/asf/flex-asjs into develop
* 'develop' of https://git-wip-us.apache.org/repos/asf/flex-asjs:
FLEX-35269 - Add UpgradeElement as default to Button and TextField which allows create them dynamically
FLEX-35269 - Make UpgradeElement available for using
FLEX-35269 - Add UpgradeElement bead responsible for registering dynamically created class using "upgradeElement" method from MDL
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/36151f71
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/36151f71
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/36151f71
Branch: refs/heads/develop
Commit: 36151f71c0e2074e9cbbf94d1d8eb986feaed5ef
Parents: f14d6a0 74ea47c
Author: Harbs <ha...@in-tools.com>
Authored: Tue Feb 21 10:40:38 2017 +0200
Committer: Harbs <ha...@in-tools.com>
Committed: Tue Feb 21 10:40:38 2017 +0200
----------------------------------------------------------------------
.../src/main/flex/MDLClasses.as | 1 +
.../src/main/flex/org/apache/flex/mdl/Button.as | 2 +
.../main/flex/org/apache/flex/mdl/TextField.as | 4 +-
.../org/apache/flex/mdl/beads/UpgradeElement.as | 122 +++++++++++++++++++
4 files changed, 128 insertions(+), 1 deletion(-)
----------------------------------------------------------------------