Skip to content
This repository
Browse code

Fixes #2553 — Addresses issue where underlying checkboxes/radio butto…

…ns were not being updated when enhanced buttons were clicked.
  • Loading branch information...
commit 8da75eb6b5de0d283e2061347f2575c240d32fce 1 parent 7e7b1b6
Mat Marquis authored January 12, 2012

Showing 1 changed file with 9 additions and 11 deletions. Show diff stats Hide diff stats

  1. 20  js/jquery.mobile.forms.checkboxradio.js
20  js/jquery.mobile.forms.checkboxradio.js
@@ -74,8 +74,8 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
74 74
 				}
75 75
 
76 76
 				self._cacheVals();
77  
-
78  
-				input.prop( "checked", inputtype === "radio" && true || !input.prop( "checked" ) );
  77
+				input.attr( "checked", inputtype === "radio" && true || !input.attr( "checked" ) );
  78
+				//input.prop( "checked", inputtype === "radio" && true || !input.attr( "checked" ) );
79 79
 
80 80
 				// trigger click handler's bound directly to the input as a substitute for
81 81
 				// how label clicks behave normally in the browsers
@@ -87,7 +87,7 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
87 87
 				// Input set for common radio buttons will contain all the radio
88 88
 				// buttons, but will not for checkboxes. clearing the checked status
89 89
 				// of other radios ensures the active button state is applied properly
90  
-				self._getInputSet().not( input ).prop( "checked", false );
  90
+				self._getInputSet().not( input ).removeAttr( "checked" );
91 91
 
92 92
 				self._updateAll();
93 93
 				return false;
@@ -107,11 +107,11 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
107 107
 					// Adds checked attribute to checked input when keyboard is used
108 108
 					if ( $this.is( ":checked" ) ) {
109 109
 
110  
-						$this.prop( "checked", true);
111  
-						self._getInputSet().not($this).prop( "checked", false );
  110
+						$this.attr( "checked", "checked" );
  111
+						self._getInputSet().not($this).removeAttr( "checked" );
112 112
 					} else {
113 113
 
114  
-						$this.prop( "checked", false );
  114
+						$this.removeAttr( "checked" );
115 115
 					}
116 116
 
117 117
 					self._updateAll();
@@ -167,13 +167,11 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
167 167
 
168 168
 		// input[0].checked expando doesn't always report the proper value
169 169
 		// for checked='checked'
170  
-		if ( $( input[ 0 ] ).prop( "checked" ) ) {
171  
-
  170
+		
  171
+		if ( input[ 0 ].getAttribute( "checked" ) ) {
172 172
 			label.addClass( this.checkedClass ).removeClass( this.uncheckedClass );
173 173
 			icon.addClass( this.checkedicon ).removeClass( this.uncheckedicon );
174  
-
175 174
 		} else {
176  
-
177 175
 			label.removeClass( this.checkedClass ).addClass( this.uncheckedClass );
178 176
 			icon.removeClass( this.checkedicon ).addClass( this.uncheckedicon );
179 177
 		}
@@ -186,7 +184,7 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
186 184
 	},
187 185
 
188 186
 	disable: function() {
189  
-		this.element.prop( "disabled", true ).parent().addClass( "ui-disabled" );
  187
+		this.element.attr( "disabled", true ).parent().addClass( "ui-disabled" );
190 188
 	},
191 189
 
192 190
 	enable: function() {

0 notes on commit 8da75eb

Please sign in to comment.
Something went wrong with that request. Please try again.