flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [4/5] git commit: [flex-asjs] [refs/heads/develop] - Get DataBindingExample back to normal by handling contentArea in a few more APIs
Date Thu, 27 Aug 2015 20:55:51 GMT
Get DataBindingExample back to normal by handling contentArea in a few more APIs


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

Branch: refs/heads/develop
Commit: ff40a5b07497b237682c7970a8eb925e6e475beb
Parents: ee1a596
Author: Alex Harui <aharui@apache.org>
Authored: Thu Aug 27 13:34:27 2015 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Thu Aug 27 13:34:27 2015 -0700

----------------------------------------------------------------------
 .../src/org/apache/flex/core/ContainerBase.js   | 24 +++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ff40a5b0/frameworks/projects/Core/js/src/org/apache/flex/core/ContainerBase.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/js/src/org/apache/flex/core/ContainerBase.js b/frameworks/projects/Core/js/src/org/apache/flex/core/ContainerBase.js
index 450bce8..34a3d7a 100644
--- a/frameworks/projects/Core/js/src/org/apache/flex/core/ContainerBase.js
+++ b/frameworks/projects/Core/js/src/org/apache/flex/core/ContainerBase.js
@@ -197,7 +197,7 @@ org.apache.flex.core.ContainerBase.prototype.addElementAt = function(c,
index, o
      //this.actualParent.addElementAt(c, index);
      var children2 = this.actualParent.internalChildren();
      if (index >= children2.length) {
-       this.actualParent.element.appendChild(c);
+       this.actualParent.element.appendChild(c.positioner);
        c.addedToParent();
      } else {
        this.actualParent.element.insertBefore(c.positioner,
@@ -224,10 +224,32 @@ org.apache.flex.core.ContainerBase.prototype.getElementAt = function(index)
{
  */
 org.apache.flex.core.ContainerBase.prototype.removeElement = function(c) {
   if (this.supportsChromeChildren && org.apache.flex.utils.Language.is(c, org.apache.flex.core.IChrome))
{
+     this.element.removeChild(c.element);
+  }
+  else {
      this.actualParent.element.removeChild(c.element);
   }
+};
+
+
+/**
+ * @override
+ */
+org.apache.flex.core.ContainerBase.prototype.getElementIndex = function(c) {
+  var children;
+  if (this.supportsChromeChildren && org.apache.flex.utils.Language.is(c, org.apache.flex.core.IChrome))
{
+     children = this.internalChildren();
+  }
   else {
+    children = this.actualParent.internalChildren();
+  }
+  var n = children.length;
+  for (var i = 0; i < n; i++)
+  {
+    if (children[i] == c.element)
+      return i;
   }
+  return -1;
 };
 
 


Mime
View raw message