Update wc-orders.js to resolve jQuery data change in jQuery 3

This commit is contained in:
Jonathan Sadowski 2021-03-02 09:34:00 -06:00
parent 8f013a9c9a
commit f685cda40d
1 changed files with 3 additions and 3 deletions

View File

@ -45,12 +45,12 @@ jQuery( function( $ ) {
*/
WCOrdersTable.prototype.onPreview = function() {
var $previewButton = $( this ),
$order_id = $previewButton.data( 'order-id' );
$order_id = $previewButton.data( 'orderId' );
if ( $previewButton.data( 'order-data' ) ) {
$( this ).WCBackboneModal({
template: 'wc-modal-view-order',
variable : $previewButton.data( 'order-data' )
variable : $previewButton.data( 'orderData' )
});
} else {
$previewButton.addClass( 'disabled' );
@ -67,7 +67,7 @@ jQuery( function( $ ) {
$( '.order-preview' ).removeClass( 'disabled' );
if ( response.success ) {
$previewButton.data( 'order-data', response.data );
$previewButton.data( 'orderData', response.data );
$( this ).WCBackboneModal({
template: 'wc-modal-view-order',