Skip to content

Commit

Permalink
* More JS bugfixes for attr() -> prop().
Browse files Browse the repository at this point in the history
  * Bugfix for recurring in CP.
  • Loading branch information
Ahaenor committed Apr 24, 2018
1 parent 3059192 commit 8d0d4c1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion assets/js/public.js
Expand Up @@ -952,7 +952,7 @@ var leykaValidateForm,

// Remember payment option
$remembered_pm.closest('.leyka-js-another-step').attr('href', 'amount');
$recurring_option.attr('checked', true);
$recurring_option.prop('checked', true);
$remembered_pm.text($recurring_option.closest('.payment-opt').find('.payment-opt__label').text());

} else {
Expand Down
2 changes: 1 addition & 1 deletion gateways/cp/leyka-class-cp-gateway.php
Expand Up @@ -81,7 +81,7 @@ public function enqueue_gateway_scripts() {

if(Leyka_CP_Card::get_instance()->active) {

wp_enqueue_script('leyka-cp-widget', 'https://widget.cloudpayments.ru/bundles/cloudpayments');
wp_enqueue_script('leyka-cp-widget', 'https://widget.cloudpayments.ru/bundles/cloudpayments', array(), false, true);
wp_enqueue_script(
'leyka-cp',
LEYKA_PLUGIN_BASE_URL.'gateways/'.Leyka_CP_Gateway::get_instance()->id.'/js/leyka.cp.js',
Expand Down
6 changes: 3 additions & 3 deletions js/public.js
Expand Up @@ -290,10 +290,10 @@ jQuery(document).ready(function($){

var field_is_valid = true;

if($field.attr('type') == 'checkbox') {
if($field.attr('type') === 'checkbox') {

var $required_checkbox_fields = $form.find('input[type="checkbox"].required:visible:not(:checked)');
if( !$field.prop('checked') || $required_checkbox_fields.length) {
if( !$field.prop('checked') || $required_checkbox_fields.length ) {

field_is_valid = false;
$form.find('.'+$field.attr('name')+'-error').html(leyka.checkbox_check_required).show();
Expand All @@ -302,7 +302,7 @@ jQuery(document).ready(function($){
$form.find('.'+$field.attr('name')+'-error').html('').hide();
}

} else if($field.attr('type') == 'text' && $field.attr('name') != 'leyka_donation_amount') {
} else if($field.attr('type') === 'text' && $field.attr('name') !== 'leyka_donation_amount') {

if( !$field.val().length ) {

Expand Down
2 changes: 1 addition & 1 deletion src/js/front/model-form.js
Expand Up @@ -571,7 +571,7 @@ var leykaValidateForm,

// Remember payment option
$remembered_pm.closest('.leyka-js-another-step').attr('href', 'amount');
$recurring_option.attr('checked', true);
$recurring_option.prop('checked', true);
$remembered_pm.text($recurring_option.closest('.payment-opt').find('.payment-opt__label').text());

} else {
Expand Down

0 comments on commit 8d0d4c1

Please sign in to comment.