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 2015/01/09 17:10:20 UTC

[07/22] git commit: [flex-asjs] [refs/heads/develop] - if explicitly sized, size the children

if explicitly sized, size the children


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

Branch: refs/heads/develop
Commit: 6653f1437086906ebbd5d105d59ecb69f9930a3f
Parents: 8b357cf
Author: Alex Harui <ah...@apache.org>
Authored: Tue Jan 6 21:37:20 2015 -0800
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Jan 9 08:09:47 2015 -0800

----------------------------------------------------------------------
 .../src/org/apache/flex/html/beads/PanelView.js | 26 +++++++++++++++++---
 1 file changed, 23 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/6653f143/frameworks/js/FlexJS/src/org/apache/flex/html/beads/PanelView.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/beads/PanelView.js b/frameworks/js/FlexJS/src/org/apache/flex/html/beads/PanelView.js
index 6a87bca..942127d 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/html/beads/PanelView.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/beads/PanelView.js
@@ -72,16 +72,36 @@ org.apache.flex.html.beads.PanelView.prototype.set_strand =
  */
 org.apache.flex.html.beads.PanelView.prototype.changeHandler =
     function(event) {
+  var strand = this.strand_;
   if (!this.titleBarAdded_)
   {
     this.titleBarAdded_ = true;
-    this.strand_.addElement(this.strand_.titleBar);
-    this.strand_.addElement(this.strand_.controlBar);
+    strand.addElement(strand.titleBar);
+    strand.addElement(strand.controlBar);
   }
 
   if (event.type == 'titleChange') {
-    this.strand_.titleBar.set_title(this.strand_.model.get_title());
+    strand.titleBar.set_title(strand.model.get_title());
   }
 
+  var p = this.strand_.positioner;
+  if (!strand.isWidthSizedToContent()) {
+    var w = strand.get_width();
+	w -= p.offsetWidth - p.clientWidth;
+    strand.titleBar.setWidth(w);
+    strand.contentArea.style.width = w.toString() + "px";
+    if (strand.controlBar)
+      strand.controlBar.setWidth(w);
+  }
+  if (!strand.isHeightSizedToContent()) {
+    var t = strand.titleBar.get_height();
+    var b = 0;
+    if (strand.controlBar)
+      b = strand.controlBar.get_height();
+    strand.contentArea.style.top = t.toString() + "px";
+	var h = strand.get_height() - t - b;
+	h -= p.offsetHeight - p.clientHeight;
+    strand.contentArea.style.height = h.toString() + "px";
+  }
   this.strand_.dispatchEvent('layoutNeeded');
 };