flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [07/31] git commit: [flex-asjs] [refs/heads/develop] - MXML containers are their own document
Date Tue, 09 Dec 2014 05:16:54 GMT
MXML containers are their own document


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

Branch: refs/heads/develop
Commit: 840685ec13e1bb4a882f5cdb08e92e5d3cab70f5
Parents: f5c4df7
Author: Alex Harui <aharui@apache.org>
Authored: Fri Nov 21 16:44:13 2014 -0800
Committer: Alex Harui <aharui@apache.org>
Committed: Mon Dec 8 20:47:40 2014 -0800

----------------------------------------------------------------------
 .../FlexJS/src/org/apache/flex/core/ViewBase.js | 40 ++++++++++++++++++--
 1 file changed, 37 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/840685ec/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 9785941..17cf1bc 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/core/ViewBase.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/ViewBase.js
@@ -49,6 +49,14 @@ org.apache.flex.core.ViewBase = function() {
    */
   this.currentState_ = '';
 
+  /**
+   * @private
+   * @type {boolean}
+   */
+  this.initialized_ = false;
+  
+  this.document = this;
+
 };
 goog.inherits(org.apache.flex.core.ViewBase, org.apache.flex.core.UIBase);
 
@@ -89,6 +97,25 @@ org.apache.flex.core.ViewBase.prototype.MXMLDescriptor = null;
 
 /**
  * @expose
+ * @type {Object} The document.
+ */
+org.apache.flex.core.ViewBase.prototype.document = null;
+
+
+/**
+ * @expose
+ * @param {Object} doc The document.
+ * @param {Array} desc The descriptor data;
+ */
+org.apache.flex.core.ViewBase.prototype.setMXMLDescriptor =
+    function(doc, desc) {
+  this.MXMLDescriptor = desc;
+  this.document = doc;
+}
+
+
+/**
+ * @expose
  */
 org.apache.flex.core.ViewBase.prototype.addedToParent = function() {
 
@@ -98,10 +125,17 @@ org.apache.flex.core.ViewBase.prototype.addedToParent = function() {
     org.apache.flex.core.ValuesManager.valuesImpl.init(this);
   }
 
-  org.apache.flex.utils.MXMLDataInterpreter.generateMXMLInstances(this,
-      this, this.get_MXMLDescriptor());
+  org.apache.flex.core.ViewBase.base(this, 'addedToParent')
 
-  this.dispatchEvent(new org.apache.flex.events.Event('initComplete'));
+  if (!this.initialized_) {
+    org.apache.flex.utils.MXMLDataInterpreter.generateMXMLInstances(this.document,
+      this, this.MXMLDescriptor);
+
+    this.dispatchEvent(new org.apache.flex.events.Event('initBindings'));
+    this.dispatchEvent(new org.apache.flex.events.Event('initComplete'));
+    this.initialized_ = true;
+  }
+  this.dispatchEvent(new org.apache.flex.events.Event('childrenAdded'));
 };
 
 


Mime
View raw message