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/09/25 18:04:13 UTC
[31/50] git commit: [flex-asjs] [refs/heads/develop] - change timing
of adding chrome
change timing of adding chrome
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/2ed1a94d
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/2ed1a94d
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/2ed1a94d
Branch: refs/heads/develop
Commit: 2ed1a94d2fa11cd3712f568a0c71403b93d51744
Parents: 7023f87
Author: Alex Harui <ah...@apache.org>
Authored: Tue Sep 23 09:47:43 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Sep 23 15:01:21 2014 -0700
----------------------------------------------------------------------
.../src/org/apache/flex/html/beads/PanelView.js | 23 ++++++++++++++++----
1 file changed, 19 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2ed1a94d/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 232efcc..6a87bca 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
@@ -20,6 +20,11 @@ goog.provide('org.apache.flex.html.beads.PanelView');
* @constructor
*/
org.apache.flex.html.beads.PanelView = function() {
+ /**
+ * @private
+ * @type {boolean}
+ */
+ this.titleBarAdded_ = false;
};
@@ -45,13 +50,14 @@ org.apache.flex.html.beads.PanelView.prototype.set_strand =
this.strand_ = value;
this.strand_.titleBar = new org.apache.flex.html.TitleBar();
- this.strand_.titleBar.addedToParent();
- this.strand_.titleBar.element.id = 'titleBar';
- this.strand_.addElement(this.strand_.titleBar);
+ this.strand_.titleBar.set_id('titleBar');
+ this.strand_.titleBar.set_model(this.strand_.get_model());
this.strand_.controlBar =
new org.apache.flex.html.ControlBar();
- this.strand_.addElement(this.strand_.controlBar);
+
+ this.strand_.addEventListener('childrenAdded',
+ goog.bind(this.changeHandler, this));
// listen for changes to the strand's model so items can be changed
// in the view
@@ -66,7 +72,16 @@ org.apache.flex.html.beads.PanelView.prototype.set_strand =
*/
org.apache.flex.html.beads.PanelView.prototype.changeHandler =
function(event) {
+ if (!this.titleBarAdded_)
+ {
+ this.titleBarAdded_ = true;
+ this.strand_.addElement(this.strand_.titleBar);
+ this.strand_.addElement(this.strand_.controlBar);
+ }
+
if (event.type == 'titleChange') {
this.strand_.titleBar.set_title(this.strand_.model.get_title());
}
+
+ this.strand_.dispatchEvent('layoutNeeded');
};