flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [3/4] git commit: [flex-asjs] [refs/heads/develop] - skip layout if not in the DOM because your measurements are invalid
Date Fri, 28 Aug 2015 20:53:51 GMT
skip layout if not in the DOM because your measurements are invalid


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

Branch: refs/heads/develop
Commit: 00f2d2c8e3dfacc03ebc7930188aab213e6cca9b
Parents: 8ad4565
Author: Alex Harui <aharui@apache.org>
Authored: Fri Aug 28 13:53:14 2015 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Fri Aug 28 13:53:14 2015 -0700

----------------------------------------------------------------------
 .../HTML/js/src/org/apache/flex/html/beads/ContainerView.js      | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/00f2d2c8/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ContainerView.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ContainerView.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ContainerView.js
index 6e60e27..26bae27 100644
--- a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ContainerView.js
+++ b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ContainerView.js
@@ -92,7 +92,9 @@ org.apache.flex.html.beads.ContainerView.
          this.completeSetup();
 
          var num = this.contentView.numElements;
-         if (num > 0) {
+         // make sure there are children AND you are in the DOM before laying out.
+         // If not in the DOM, you'll get funky numbers
+         if (num > 0 && document.contains(this.host.element)) {
            this.performLayout(event);
          }
    }


Mime
View raw message