Skip to content

Commit

Permalink
Fix: Deprecated .change()
Browse files Browse the repository at this point in the history
  • Loading branch information
Dernerd committed Dec 24, 2023
1 parent 3712ef5 commit f845d21
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions includes/admin/ui/js/admin-orders.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
}
}
} );
} ).change();
} ).trigger("change");
};

var initCustomerInfoLightbox = function() {
Expand Down Expand Up @@ -112,7 +112,7 @@
$('.mp-order-custom-tracking-link').addClass('mp-hide');
}

}).change();
}).trigger("change");
};

var removeCustomShippingMethod = function () {
Expand All @@ -133,7 +133,7 @@
success: function (data) {
if (data.status == 'success') {
$('select[name="mp[tracking_info][shipping_method]"] option[value="' + selected + '"]').remove();
$('select[name="mp[tracking_info][shipping_method]"]').change();
$('select[name="mp[tracking_info][shipping_method]"]').trigger("change");
} else {
alert(data.err);
}
Expand Down
2 changes: 1 addition & 1 deletion includes/admin/ui/js/admin-product.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ jQuery(document).ready(function($) {

$(this).parent().find('.currency').removeClass('.no_currency');
$(this).parent().find('.currency').show();
connectWith.val($(this).val()).change();
connectWith.val($(this).val()).trigger("change");
if (data_type == 'number') {
var numeric_value = $(this).val().trim();
numeric_value = numeric_value.replace(",", "."); //convert comma to dot
Expand Down
2 changes: 1 addition & 1 deletion includes/admin/ui/js/mp-dashboard-widgets.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jQuery( document ).ready( function( $ ) {
replaceWith.blur( function( ) {

if ( $( this ).val( ) != "" ) {
connectWith.val( $( this ).val() ).change( );
connectWith.val( $( this ).val() ).trigger("change");
if ( data_type == 'number' ) {
var numeric_value = $( this ).val();
numeric_value = numeric_value.replace( ",", "" );
Expand Down
2 changes: 1 addition & 1 deletion includes/psource-metaboxes/ui/js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jQuery.validator.addMethod( 'lessthan', function( value, element, param ) {
/* initializing conditional logic here instead of document.ready() to prevent
issues with wysiwyg editor not getting proper height */
initConditionals();
$( '.psource-postbox' ).find( ':checkbox, :radio, select' ).change( initConditionals );
$( '.psource-postbox' ).find( ':checkbox, :radio, select' ).on("change", initConditionals );
}

$( document ).on( 'psource_repeater_field/after_add_field_group', function( e ) {
Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ Halte Dich mit unserem [Newsletter](https://n3rds.work/webmasterservice-n3rdswor
* Fix: Deprecated .resize()
* Fix: Deprecated .hover()
* Fix: Deprecated .click()
* Fix: Deprecated .change()

= 3.5.6 =

Expand Down
4 changes: 2 additions & 2 deletions ui/js/mp-checkout.js
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ var mp_checkout;
var $enableRegistration = $( 'input[name="enable_registration_form"]' );

// Enable account registration fields
$enableRegistration.change( mp_checkout.toggleRegistrationFields );
$enableRegistration.on("change", mp_checkout.toggleRegistrationFields );
},
/**
* Initialize events related to shipping address fields
Expand All @@ -535,7 +535,7 @@ var mp_checkout;
var $enableShippingAddress = $( 'input[name="enable_shipping_address"]' );

// Enable billing address fields
$enableShippingAddress.change( mp_checkout.toggleShippingAddressFields );
$enableShippingAddress.on("change", mp_checkout.toggleShippingAddressFields );

// Copy billing field to shipping field (if shipping address isn't enabled)
$( '[name^="billing["]' ).on( 'change keyup', function() {
Expand Down

0 comments on commit f845d21

Please sign in to comment.