You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by pe...@apache.org on 2013/08/22 16:27:05 UTC

git commit: [flex-asjs] [refs/heads/develop] - Modifications to sync JavaScript components with recent changes to FlexJS framework.

Updated Branches:
  refs/heads/develop e305d18a1 -> 93054918e


Modifications to sync JavaScript components with recent changes to FlexJS framework.


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

Branch: refs/heads/develop
Commit: 93054918e8e76ac7d62325025e5ec71e5d81b38c
Parents: e305d18
Author: Peter Ent <pe...@apache.org>
Authored: Thu Aug 22 10:26:54 2013 -0400
Committer: Peter Ent <pe...@apache.org>
Committed: Thu Aug 22 10:26:54 2013 -0400

----------------------------------------------------------------------
 .../apache/flex/html/staticControls/ComboBox.js |  7 +-
 .../flex/jquery/staticControls/CheckBox.js      |  2 +-
 .../flex/jquery/staticControls/RadioButton.js   | 72 +++++++++-----------
 .../flex/jquery/staticControls/TextButton.js    |  2 +-
 4 files changed, 36 insertions(+), 47 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/93054918/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/ComboBox.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/ComboBox.js b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/ComboBox.js
index 6edfdb9..04f88b4 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/ComboBox.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/ComboBox.js
@@ -60,10 +60,9 @@ org.apache.flex.html.staticControls.ComboBox.prototype.createElement =
 
   this.positioner = this.element;
 
-  // add a click handler to p's parentElement so that a click
-  // outside of the combo box can dismiss the pop-up should it
-  // be visible
-  goog.events.listen(p.parentElement, 'click',
+  // add a click handler so that a click outside of the combo box can 
+  // dismiss the pop-up should it be visible.
+  goog.events.listen(document, 'click',
       goog.bind(this.dismissPopup, this));
 
   input.flexjs_wrapper = this;

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/93054918/frameworks/js/FlexJS/src/org/apache/flex/jquery/staticControls/CheckBox.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/jquery/staticControls/CheckBox.js b/frameworks/js/FlexJS/src/org/apache/flex/jquery/staticControls/CheckBox.js
index 8f1fc43..19e5bcf 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/jquery/staticControls/CheckBox.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/jquery/staticControls/CheckBox.js
@@ -50,11 +50,11 @@ org.apache.flex.jquery.staticControls.CheckBox.prototype.createElement =
   d.appendChild(lb);
 
   this.element = d;
-  p.appendChild(this.element);
 
   $(cb).button();
 
   this.positioner = this.element;
+  this.element.flexjs_wrapper = this;
 };
 
 

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/93054918/frameworks/js/FlexJS/src/org/apache/flex/jquery/staticControls/RadioButton.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/jquery/staticControls/RadioButton.js b/frameworks/js/FlexJS/src/org/apache/flex/jquery/staticControls/RadioButton.js
index 07719b6..85ce154 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/jquery/staticControls/RadioButton.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/jquery/staticControls/RadioButton.js
@@ -65,43 +65,6 @@ org.apache.flex.jquery.staticControls.RadioButton.groupHandlerSet = false;
 org.apache.flex.jquery.staticControls.RadioButton.prototype.createElement =
     function() {
 
-/*
- * NOTE: Ideally when a RadioButton was created it would be added to an
- * existing set of RadioButtons.
- * This is especially true for RadioButtons added dynamically. However, due
- * to a bug in jQuery
- * (see http://bugs.jqueryui.com/ticket/8975), it is currently not possible
- * to add or remove RadioButtons
- * programmatically. For this version the groups are maintained here in
- * RadioButton and once the
- * application has finished initializing, the groups are given their
- * buttonset().
- */
-
-    this.radioGroupName = value;
-
-    this.element.name = value;
-
-    var div;
-    var groups = org.apache.flex.jquery.staticControls.RadioButton.groups;
-    if (groups[value]) {
-        div = groups[value];
-        div.appendChild(this.element);
-        div.appendChild(this.labelFor);
-    }
-    else {
-        var p = this.element.parentElement;
-        div = document.createElement('div');
-        div.id = value;
-        div.appendChild(this.element);
-        div.appendChild(this.labelFor);
-        p.appendChild(div);
-
-        groups[String(value)] = div;
-    }
-
-    this.positioner = div;
-
     var input = document.createElement('input');
     input.type = 'radio';
     input.name = 'radio';
@@ -111,13 +74,11 @@ org.apache.flex.jquery.staticControls.RadioButton.prototype.createElement =
     var label = document.createElement('label');
     label.htmlFor = input.id;
 
-    p.appendChild(input);
-    p.appendChild(label);
-
     this.element = input;
     this.labelFor = label;
 
     this.positioner = this.element;
+    this.flexjs_wrapper = this;
 };
 
 /**
@@ -167,8 +128,37 @@ org.apache.flex.jquery.staticControls.RadioButton.prototype.get_groupName =
  * @param {string} value The groupName setter.
  */
 org.apache.flex.jquery.staticControls.RadioButton.prototype.set_groupName =
-    function(value) {
+function(value) {
 
+/*
+ * NOTE: Ideally when a RadioButton was created it would be added to an existing set of RadioButtons.
+ * This is especially true for RadioButtons added dynamically. However, due to a bug in jQuery
+ * (see http://bugs.jqueryui.com/ticket/8975), it is currently not possible to add or remove RadioButtons
+ * programmatically. For this version the groups are maintained here in RadioButton and once the
+ * application has finished initializing, the groups are given their buttonset().
+ */
+ 
+	this.radioGroupName = value;
+
+	this.element.name = value;
+
+	var div;
+
+	if( org.apache.flex.jquery.staticControls.RadioButton.groups[value] ) {
+		div = org.apache.flex.jquery.staticControls.RadioButton.groups[value];
+		div.appendChild(this.element);
+		div.appendChild(this.labelFor);
+	}
+	else {
+		div = document.createElement('div');
+		div.id = value;
+		div.appendChild(this.element);
+		div.appendChild(this.labelFor);
+
+		org.apache.flex.jquery.staticControls.RadioButton.groups[String(value)] = div;
+	}
+
+	this.positioner = div;
 };
 
 /**

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/93054918/frameworks/js/FlexJS/src/org/apache/flex/jquery/staticControls/TextButton.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/jquery/staticControls/TextButton.js b/frameworks/js/FlexJS/src/org/apache/flex/jquery/staticControls/TextButton.js
index 9b0a586..4d30224 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/jquery/staticControls/TextButton.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/jquery/staticControls/TextButton.js
@@ -38,9 +38,9 @@ org.apache.flex.jquery.staticControls.TextButton.prototype.createElement =
   this.element = document.createElement('button');
   this.element.setAttribute('type', 'button');
   $(this.element).button();
-  p.appendChild(this.element);
 
   this.positioner = this.element;
+  this.element.flexjs_wrapper = this;
 };