Return-Path: X-Original-To: apmail-flex-commits-archive@www.apache.org Delivered-To: apmail-flex-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7205DCF13 for ; Fri, 9 Jan 2015 16:10:15 +0000 (UTC) Received: (qmail 84837 invoked by uid 500); 9 Jan 2015 16:10:15 -0000 Delivered-To: apmail-flex-commits-archive@flex.apache.org Received: (qmail 84751 invoked by uid 500); 9 Jan 2015 16:10:15 -0000 Mailing-List: contact commits-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flex.apache.org Delivered-To: mailing list commits@flex.apache.org Received: (qmail 84563 invoked by uid 99); 9 Jan 2015 16:10:15 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Jan 2015 16:10:15 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id A57E08165B7; Fri, 9 Jan 2015 16:10:14 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: aharui@apache.org To: commits@flex.apache.org Date: Fri, 09 Jan 2015 16:10:23 -0000 Message-Id: <6676ea46ceb342628115d380a6e52b86@git.apache.org> In-Reply-To: <5f6919156544494491919c0a4523eb8a@git.apache.org> References: <5f6919156544494491919c0a4523eb8a@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [10/22] git commit: [flex-asjs] [refs/heads/develop] - get panel to accept custom titlebar get panel to accept custom titlebar Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/b6f5f20b Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/b6f5f20b Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/b6f5f20b Branch: refs/heads/develop Commit: b6f5f20bc605b2e1fb1d1d6c39b988927f1ce000 Parents: 184b7e9 Author: Alex Harui Authored: Wed Jan 7 20:39:43 2015 -0800 Committer: Alex Harui Committed: Fri Jan 9 08:09:48 2015 -0800 ---------------------------------------------------------------------- .../src/org/apache/flex/html/beads/PanelView.js | 23 +++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b6f5f20b/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 942127d..633b1db 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 @@ -14,6 +14,8 @@ goog.provide('org.apache.flex.html.beads.PanelView'); +goog.require('org.apache.flex.core.IBeadView'); + /** @@ -37,7 +39,8 @@ org.apache.flex.html.beads.PanelView = function() { org.apache.flex.html.beads.PanelView .prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'PanelView', - qName: 'org.apache.flex.html.beads.PanelView'}] }; + qName: 'org.apache.flex.html.beads.PanelView'}], + interfaces: [org.apache.flex.core.IBeadView] }; /** @@ -49,7 +52,11 @@ org.apache.flex.html.beads.PanelView.prototype.set_strand = this.strand_ = value; - this.strand_.titleBar = new org.apache.flex.html.TitleBar(); + if (!this.titleBar) + this.strand_.titleBar = new org.apache.flex.html.TitleBar(); + else + this.strand_.titleBar = this.titleBar; + this.strand_.titleBar.set_id('titleBar'); this.strand_.titleBar.set_model(this.strand_.get_model()); @@ -87,9 +94,9 @@ org.apache.flex.html.beads.PanelView.prototype.changeHandler = var p = this.strand_.positioner; if (!strand.isWidthSizedToContent()) { var w = strand.get_width(); - w -= p.offsetWidth - p.clientWidth; + w -= p.offsetWidth - p.clientWidth; strand.titleBar.setWidth(w); - strand.contentArea.style.width = w.toString() + "px"; + strand.contentArea.style.width = w.toString() + 'px'; if (strand.controlBar) strand.controlBar.setWidth(w); } @@ -98,10 +105,10 @@ org.apache.flex.html.beads.PanelView.prototype.changeHandler = 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"; + 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'); };