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:03:57 UTC
[15/50] git commit: [flex-asjs] [refs/heads/develop] - change
TitleBar to use beads. It won't work until I fix other things,
but it is a start
change TitleBar to use beads. It won't work until I fix other things, but it is a start
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/727195d3
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/727195d3
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/727195d3
Branch: refs/heads/develop
Commit: 727195d3dd799a61f99b0eac30f88b876170652b
Parents: a99dfd4
Author: Alex Harui <ah...@apache.org>
Authored: Wed Sep 17 15:00:49 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Sep 23 14:49:47 2014 -0700
----------------------------------------------------------------------
frameworks/as/projects/FlexJSUI/defaults.css | 18 +++----
.../FlexJS/src/org/apache/flex/html/TitleBar.js | 50 --------------------
2 files changed, 9 insertions(+), 59 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/727195d3/frameworks/as/projects/FlexJSUI/defaults.css
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/defaults.css b/frameworks/as/projects/FlexJSUI/defaults.css
index 886f1c0..a723ceb 100644
--- a/frameworks/as/projects/FlexJSUI/defaults.css
+++ b/frameworks/as/projects/FlexJSUI/defaults.css
@@ -124,6 +124,15 @@ StringItemRenderer
height: 16;
}
+TitleBar
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.TitleBarModel");
+ IBeadView: ClassReference("org.apache.flex.html.beads.TitleBarView");
+ IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.FlexibleFirstChildHorizontalLayout");
+ iMeasurementBead: ClassReference("org.apache.flex.html.beads.TitleBarMeasurementBead");
+ background-color: #FFFFFF;
+}
+
/* Global Style Declaration */
global
{
@@ -370,15 +379,6 @@ TextInput
height: 20;
}
-TitleBar
-{
- IBeadModel: ClassReference("org.apache.flex.html.beads.models.TitleBarModel");
- IBeadView: ClassReference("org.apache.flex.html.beads.TitleBarView");
- IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.FlexibleFirstChildHorizontalLayout");
- iMeasurementBead: ClassReference("org.apache.flex.html.beads.TitleBarMeasurementBead");
- background-color: #FFFFFF;
-}
-
ToggleTextButton
{
IBeadModel: ClassReference("org.apache.flex.html.beads.models.ToggleButtonModel");
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/727195d3/frameworks/js/FlexJS/src/org/apache/flex/html/TitleBar.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/TitleBar.js b/frameworks/js/FlexJS/src/org/apache/flex/html/TitleBar.js
index 16e60f6..0f4a405 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/html/TitleBar.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/TitleBar.js
@@ -27,9 +27,6 @@ goog.require('org.apache.flex.html.beads.models.TitleBarModel');
*/
org.apache.flex.html.TitleBar = function() {
- this.model =
- new org.apache.flex.html.beads.models.TitleBarModel();
-
org.apache.flex.html.TitleBar.base(this, 'constructor');
};
goog.inherits(org.apache.flex.html.TitleBar,
@@ -54,63 +51,16 @@ org.apache.flex.html.TitleBar.prototype.createElement =
this.element = document.createElement('div');
- this.titleLabel = new org.apache.flex.html.Label();
- this.addElement(this.titleLabel);
- this.titleLabel.element.id = 'title';
- this.titleLabel.positioner.style.display = 'inline-block';
- this.titleLabel.set_className('TitleBarLabel');
-
- this.titleButton = new org.apache.flex.html.TextButton();
- this.addElement(this.titleButton);
- this.titleButton.element.id = 'closeButton';
- this.titleButton.text = 'Close';
- this.titleButton.positioner.style.position = 'absolute';
- this.titleButton.positioner.style.right = '0px';
-
this.positioner = this.element;
this.element.flexjs_wrapper = this;
this.set_className('TitleBar');
- // listen for changes to the model so items can be changed in the view
- this.model.addEventListener('titleChange',
- goog.bind(this.changeHandler, this));
-
return this.element;
};
/**
- * @override
- */
-org.apache.flex.html.TitleBar.prototype.addedToParent =
- function() {
-
- this.titleLabel.set_text(this.model.get_title());
-
- if (this.model.showCloseButton) {
- this.titleButton.positioner.style.display = 'inline-block';
- } else {
- this.titleButton.positioner.style.display = 'none';
- }
-};
-
-
-/**
- * @param {Object} event The event that triggered this handler.
- */
-org.apache.flex.html.TitleBar.prototype.changeHandler =
- function(event) {
- if (event.type == 'titleChange') {
- this.titleLabel.set_text(this.model.get_title());
- }
- else if (event.type == 'htmlTitleChange') {
- this.titleLabel.set_text(this.model.get_htmlTitle());
- }
-};
-
-
-/**
* @expose
* @return {string} The title getter.
*/