From 1746b3518d0674c101939a3b2f83e20b1c4852ca Mon Sep 17 00:00:00 2001 From: Maurice Gottlieb Date: Tue, 10 Jul 2012 20:15:02 +0300 Subject: [PATCH 1/2] Checkbox/Radio: Make links inside labels clickable. Addresses #3595 --- js/widgets/forms/checkboxradio.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/js/widgets/forms/checkboxradio.js b/js/widgets/forms/checkboxradio.js index a59ac6ae611..3549ba93e99 100644 --- a/js/widgets/forms/checkboxradio.js +++ b/js/widgets/forms/checkboxradio.js @@ -68,12 +68,12 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, { }); // Wrap the input + label in a div - var wrapper = document.createElement('div'); + var wrapper = document.createElement( 'div' ); wrapper.className = 'ui-' + inputtype; input.add( label ).wrapAll( wrapper ); - label.bind({ + label.filter( 'a' ).bind({ vmouseover: function( event ) { if ( $( this ).parent().is( ".ui-disabled" ) ) { event.stopPropagation(); @@ -119,7 +119,7 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, { // Adds checked attribute to checked input when keyboard is used if ( $this.is( ":checked" ) ) { - $this.prop( "checked", true); + $this.prop( "checked", true ); self._getInputSet().not( $this ).prop( "checked", false ); } else { @@ -142,7 +142,7 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, { }, _cacheVals: function() { - this._getInputSet().each(function() { + this._getInputSet().each( function() { $( this ).jqmData( "cacheVal", this.checked ); }); }, @@ -160,7 +160,7 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, { _updateAll: function() { var self = this; - this._getInputSet().each(function() { + this._getInputSet().each( function() { var $this = $( this ); if ( this.checked || self.inputtype === "checkbox" ) { From 931d53d34ee6e9e8fbe53bb35e69f44c34b63209 Mon Sep 17 00:00:00 2001 From: Maurice Gottlieb Date: Tue, 10 Jul 2012 21:46:35 +0300 Subject: [PATCH 2/2] Remove too liberal spaces in front of functions. Thanks uGoMobi --- js/widgets/forms/checkboxradio.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/widgets/forms/checkboxradio.js b/js/widgets/forms/checkboxradio.js index 3549ba93e99..63260485168 100644 --- a/js/widgets/forms/checkboxradio.js +++ b/js/widgets/forms/checkboxradio.js @@ -142,7 +142,7 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, { }, _cacheVals: function() { - this._getInputSet().each( function() { + this._getInputSet().each(function() { $( this ).jqmData( "cacheVal", this.checked ); }); }, @@ -160,7 +160,7 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, { _updateAll: function() { var self = this; - this._getInputSet().each( function() { + this._getInputSet().each(function() { var $this = $( this ); if ( this.checked || self.inputtype === "checkbox" ) {