flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject svn commit: r1454087 - in /flex/asjs/branches/develop/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls: CheckBox.js RadioButton.js
Date Thu, 07 Mar 2013 20:30:30 GMT
Author: pent
Date: Thu Mar  7 20:30:29 2013
New Revision: 1454087

URL: http://svn.apache.org/r1454087
Log:
Removed use of div and replaced with label

Modified:
    flex/asjs/branches/develop/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/CheckBox.js
    flex/asjs/branches/develop/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/RadioButton.js

Modified: flex/asjs/branches/develop/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/CheckBox.js
URL: http://svn.apache.org/viewvc/flex/asjs/branches/develop/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/CheckBox.js?rev=1454087&r1=1454086&r2=1454087&view=diff
==============================================================================
--- flex/asjs/branches/develop/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/CheckBox.js
(original)
+++ flex/asjs/branches/develop/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/CheckBox.js
Thu Mar  7 20:30:29 2013
@@ -36,18 +36,13 @@ goog.inherits(
  */
 org.apache.flex.html.staticControls.CheckBox.prototype.addToParent = 
     function(p) {
-    this.element = document.createElement('div');
-    
-    var cb = document.createElement('input');
-    cb.type = 'checkbox';
-    cb.id = "cb"+(cbCount++);
-    this.element.appendChild(cb);
-    
-    var label = document.createElement('label');
-    label.innerHTML = "Check Box";
-    label.setAttribute('for',cb.id);
-    this.element.appendChild(label);
-
+	this.element = document.createElement('label');
+	
+	var cb = document.createElement('input');
+	cb.type = 'checkbox';
+	this.element.appendChild(cb);
+	this.element.appendChild(document.createTextNode("check box"));
+	
     p.appendChild(this.element);
 
     this.positioner = this.element;
@@ -59,7 +54,7 @@ org.apache.flex.html.staticControls.Chec
  * @return {string} The text getter.
  */
 org.apache.flex.html.staticControls.CheckBox.prototype.get_text = function() {
-    return this.element.childNodes.item(1).innerHTML;
+    return this.element.childNodes.item(1).nodeValue;
 };
 
 /**
@@ -68,7 +63,7 @@ org.apache.flex.html.staticControls.Chec
  * @param {string} value The text setter.
  */
 org.apache.flex.html.staticControls.CheckBox.prototype.set_text = function(value) {
-    this.element.childNodes.item(1).innerHTML = value;
+    this.element.childNodes.item(1).nodeValue = value;
 };
 
 /**

Modified: flex/asjs/branches/develop/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/RadioButton.js
URL: http://svn.apache.org/viewvc/flex/asjs/branches/develop/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/RadioButton.js?rev=1454087&r1=1454086&r2=1454087&view=diff
==============================================================================
--- flex/asjs/branches/develop/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/RadioButton.js
(original)
+++ flex/asjs/branches/develop/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/RadioButton.js
Thu Mar  7 20:30:29 2013
@@ -36,17 +36,12 @@ goog.inherits(
  */
 org.apache.flex.html.staticControls.RadioButton.prototype.addToParent = 
     function(p) {
-    this.element = document.createElement('div');
-    
-    var rb = document.createElement('input');
-    rb.type = 'radio';
-    rb.id = "rb"+(rbCount++);
-    this.element.appendChild(rb);
-    
-    var label = document.createElement('label');
-    label.innerHTML = this.groupName;//"Radio Button";
-    label.setAttribute('for',rb.id);
-    this.element.appendChild(label);
+	this.element = document.createElement('label');
+	
+	var rb = document.createElement('input');
+	rb.type = 'radio';
+	this.element.appendChild(rb);
+	this.element.appendChild(document.createTextNode("radio button"));
 
     p.appendChild(this.element);
 
@@ -77,7 +72,7 @@ org.apache.flex.html.staticControls.Radi
  * @return {string} The text getter.
  */
 org.apache.flex.html.staticControls.RadioButton.prototype.get_text = function() {
-    return this.element.childNodes.item(1).innerHTML;
+    return this.element.childNodes.item(1).nodeValue;
 };
 
 /**
@@ -86,7 +81,7 @@ org.apache.flex.html.staticControls.Radi
  * @param {string} value The text setter.
  */
 org.apache.flex.html.staticControls.RadioButton.prototype.set_text = function(value) {
-    this.element.childNodes.item(1).innerHTML = value;
+    this.element.childNodes.item(1).nodeValue = value;
 };
 
 /**



Mime
View raw message