You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2014/12/23 08:41:40 UTC

[17/28] git commit: [flex-asjs] [refs/heads/develop] - set default state in setter

set default state in setter


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

Branch: refs/heads/develop
Commit: c49afea470b0cfb0eaae6e0aea2fe2c65f56ef36
Parents: 78b2016
Author: Alex Harui <ah...@apache.org>
Authored: Mon Dec 22 10:01:13 2014 -0800
Committer: Alex Harui <ah...@apache.org>
Committed: Mon Dec 22 10:01:13 2014 -0800

----------------------------------------------------------------------
 .../js/FlexJS/src/org/apache/flex/core/ContainerBase.js | 12 ++++++++++++
 .../js/FlexJS/src/org/apache/flex/core/ViewBase.js      |  1 +
 2 files changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c49afea4/frameworks/js/FlexJS/src/org/apache/flex/core/ContainerBase.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/core/ContainerBase.js b/frameworks/js/FlexJS/src/org/apache/flex/core/ContainerBase.js
index 784645d..39494dc 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/core/ContainerBase.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/ContainerBase.js
@@ -15,6 +15,7 @@
 goog.provide('org.apache.flex.core.ContainerBase');
 
 goog.require('org.apache.flex.core.UIBase');
+goog.require('org.apache.flex.core.ValuesManager');
 
 
 
@@ -151,6 +152,17 @@ org.apache.flex.core.ContainerBase.prototype.get_states = function() {
  */
 org.apache.flex.core.ContainerBase.prototype.set_states = function(s) {
   this.states_ = s;
+  this.currentState_ = s[0].name;
+
+  if (org.apache.flex.core.ValuesManager.valuesImpl.getValue) {
+    /**
+     * @type {Function}
+     */
+    var impl = /** @type {Function} */ (org.apache.flex.core.ValuesManager.valuesImpl.
+        getValue(this, 'iStatesImpl'));
+    // TODO: (aharui) check if bead already exists
+    this.addBead(new impl());
+  }
 };
 
 

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c49afea4/frameworks/js/FlexJS/src/org/apache/flex/core/ViewBase.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/core/ViewBase.js b/frameworks/js/FlexJS/src/org/apache/flex/core/ViewBase.js
index 1530ac1..12faa61 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/core/ViewBase.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/ViewBase.js
@@ -172,6 +172,7 @@ org.apache.flex.core.ViewBase.prototype.get_states = function() {
  */
 org.apache.flex.core.ViewBase.prototype.set_states = function(value) {
   this.states_ = value;
+  this.currentState_ = value[0].name;
 
   if (org.apache.flex.core.ValuesManager.valuesImpl.getValue) {
     /**