| 1 |
/** |
| 2 |
* On selection of radio button, adjust attributes of radio container |
| 3 |
* |
| 4 |
* @param _this |
| 5 |
*/ |
| 6 |
function wpbc_ui_el__radio_container_selection(_this) { |
| 7 |
|
| 8 |
if ( jQuery( _this ).is( ':checked' ) ) { |
| 9 |
jQuery( _this ).parents( '.wpbc_ui_radio_section' ).find( '.wpbc_ui_radio_container' ).removeAttr( 'data-selected' ); |
| 10 |
jQuery( _this ).parents( '.wpbc_ui_radio_container:not(.disabled)' ).attr( 'data-selected', true ); |
| 11 |
} |
| 12 |
|
| 13 |
if ( jQuery( _this ).is( ':disabled' ) ) { |
| 14 |
jQuery( _this ).parents( '.wpbc_ui_radio_container' ).addClass( 'disabled' ); |
| 15 |
} |
| 16 |
} |
| 17 |
|
| 18 |
/** |
| 19 |
* On click on Radio Container, we will select the radio button and then adjust attributes of radio container |
| 20 |
* |
| 21 |
* @param _this |
| 22 |
*/ |
| 23 |
function wpbc_ui_el__radio_container_click(_this) { |
| 24 |
|
| 25 |
if ( jQuery( _this ).hasClass( 'disabled' ) ) { |
| 26 |
return false; |
| 27 |
} |
| 28 |
|
| 29 |
var j_radio = jQuery( _this ).find( 'input[type=radio]:not(.wpbc-form-radio-internal)' ); |
| 30 |
if ( j_radio.length ) { |
| 31 |
j_radio.prop( 'checked', true ).trigger( 'change' ); |
| 32 |
} |
| 33 |
|
| 34 |
} |