Fixed js coding standards on assets/js/admin/meta-boxes-order.js and removed a reserved namespace
This commit is contained in:
parent
3b6b129c9d
commit
bf3300cc0f
|
@ -1,4 +1,4 @@
|
||||||
/*global woocommerce_admin_meta_boxes, woocommerce_admin, accounting */
|
/*global woocommerce_admin_meta_boxes, woocommerce_admin, accounting, woocommerce_admin_meta_boxes_order */
|
||||||
jQuery( function ( $ ) {
|
jQuery( function ( $ ) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -58,7 +58,7 @@ jQuery( function ( $ ) {
|
||||||
|
|
||||||
$states_select.append( $( '<option value="">' + woocommerce_admin_meta_boxes_order.i18n_select_state_text + '</option>' ) );
|
$states_select.append( $( '<option value="">' + woocommerce_admin_meta_boxes_order.i18n_select_state_text + '</option>' ) );
|
||||||
|
|
||||||
$.each( state, function( index, name ) {
|
$.each( state, function( index ) {
|
||||||
$states_select.append( $( '<option value="' + index + '">' + state[ index ] + '</option>' ) );
|
$states_select.append( $( '<option value="' + index + '">' + state[ index ] + '</option>' ) );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ jQuery( function ( $ ) {
|
||||||
$( this ).closest( '.order_data_column' ).find( 'div.edit_address' ).show();
|
$( this ).closest( '.order_data_column' ).find( 'div.edit_address' ).show();
|
||||||
},
|
},
|
||||||
|
|
||||||
change_customer_user: function( e ) {
|
change_customer_user: function() {
|
||||||
if ( ! $( '#_billing_country' ).val() ) {
|
if ( ! $( '#_billing_country' ).val() ) {
|
||||||
$( 'a.edit_address' ).click();
|
$( 'a.edit_address' ).click();
|
||||||
wc_meta_boxes_order.load_billing( true );
|
wc_meta_boxes_order.load_billing( true );
|
||||||
|
@ -231,7 +231,7 @@ jQuery( function ( $ ) {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Order Items Panel
|
* Order Items Panel
|
||||||
|
@ -481,7 +481,7 @@ jQuery( function ( $ ) {
|
||||||
url: woocommerce_admin_meta_boxes.ajax_url,
|
url: woocommerce_admin_meta_boxes.ajax_url,
|
||||||
data: data,
|
data: data,
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
success: function( response ) {
|
success: function() {
|
||||||
$item.remove();
|
$item.remove();
|
||||||
wc_meta_boxes_order_items.unblock();
|
wc_meta_boxes_order_items.unblock();
|
||||||
}
|
}
|
||||||
|
@ -720,14 +720,14 @@ jQuery( function ( $ ) {
|
||||||
var data = {
|
var data = {
|
||||||
action: 'woocommerce_delete_refund',
|
action: 'woocommerce_delete_refund',
|
||||||
refund_id: refund_id,
|
refund_id: refund_id,
|
||||||
security: woocommerce_admin_meta_boxes.order_item_nonce,
|
security: woocommerce_admin_meta_boxes.order_item_nonce
|
||||||
};
|
};
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: woocommerce_admin_meta_boxes.ajax_url,
|
url: woocommerce_admin_meta_boxes.ajax_url,
|
||||||
data: data,
|
data: data,
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
success: function( response ) {
|
success: function() {
|
||||||
wc_meta_boxes_order_items.reload_items();
|
wc_meta_boxes_order_items.reload_items();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -863,7 +863,7 @@ jQuery( function ( $ ) {
|
||||||
url: woocommerce_admin_meta_boxes.ajax_url,
|
url: woocommerce_admin_meta_boxes.ajax_url,
|
||||||
data: data,
|
data: data,
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
success: function( response ) {
|
success: function() {
|
||||||
$row.hide();
|
$row.hide();
|
||||||
wc_meta_boxes_order_items.unblock();
|
wc_meta_boxes_order_items.unblock();
|
||||||
}
|
}
|
||||||
|
@ -875,7 +875,7 @@ jQuery( function ( $ ) {
|
||||||
|
|
||||||
bulk_actions: {
|
bulk_actions: {
|
||||||
|
|
||||||
check_column: function(){
|
check_column: function() {
|
||||||
if ( $( this ).is( ':checked' ) ) {
|
if ( $( this ).is( ':checked' ) ) {
|
||||||
$( '#woocommerce-order-items' ).find( '.check-column input' ).attr( 'checked', 'checked' );
|
$( '#woocommerce-order-items' ).find( '.check-column input' ).attr( 'checked', 'checked' );
|
||||||
} else {
|
} else {
|
||||||
|
@ -901,14 +901,14 @@ jQuery( function ( $ ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( wc_meta_boxes_order_items.bulk_actions[ action ] ) {
|
if ( wc_meta_boxes_order_items.bulk_actions[ 'do_' + action ] ) {
|
||||||
wc_meta_boxes_order_items.bulk_actions[action]( selected_rows, item_ids );
|
wc_meta_boxes_order_items.bulk_actions[ 'do_' + action ]( selected_rows, item_ids );
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
delete: function( selected_rows, item_ids ) {
|
do_delete: function( selected_rows, item_ids ) {
|
||||||
if ( window.confirm( woocommerce_admin_meta_boxes.remove_item_notice ) ) {
|
if ( window.confirm( woocommerce_admin_meta_boxes.remove_item_notice ) ) {
|
||||||
|
|
||||||
wc_meta_boxes_order_items.block();
|
wc_meta_boxes_order_items.block();
|
||||||
|
@ -923,7 +923,7 @@ jQuery( function ( $ ) {
|
||||||
url: woocommerce_admin_meta_boxes.ajax_url,
|
url: woocommerce_admin_meta_boxes.ajax_url,
|
||||||
data: data,
|
data: data,
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
success: function( response ) {
|
success: function() {
|
||||||
$( selected_rows ).each(function() {
|
$( selected_rows ).each(function() {
|
||||||
$( this ).closest( 'tr' ).remove();
|
$( this ).closest( 'tr' ).remove();
|
||||||
});
|
});
|
||||||
|
@ -933,7 +933,7 @@ jQuery( function ( $ ) {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
increase_stock: function( selected_rows, item_ids ) {
|
do_increase_stock: function( selected_rows, item_ids ) {
|
||||||
wc_meta_boxes_order_items.block();
|
wc_meta_boxes_order_items.block();
|
||||||
|
|
||||||
var quantities = {};
|
var quantities = {};
|
||||||
|
@ -965,7 +965,7 @@ jQuery( function ( $ ) {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
reduce_stock: function( selected_rows, item_ids ) {
|
do_reduce_stock: function( selected_rows, item_ids ) {
|
||||||
wc_meta_boxes_order_items.block();
|
wc_meta_boxes_order_items.block();
|
||||||
|
|
||||||
var quantities = {};
|
var quantities = {};
|
||||||
|
@ -994,7 +994,7 @@ jQuery( function ( $ ) {
|
||||||
window.alert( response );
|
window.alert( response );
|
||||||
wc_meta_boxes_order_items.unblock();
|
wc_meta_boxes_order_items.unblock();
|
||||||
}
|
}
|
||||||
} );
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1145,7 +1145,7 @@ jQuery( function ( $ ) {
|
||||||
post_id: woocommerce_admin_meta_boxes.post_id,
|
post_id: woocommerce_admin_meta_boxes.post_id,
|
||||||
note: $( 'textarea#add_order_note' ).val(),
|
note: $( 'textarea#add_order_note' ).val(),
|
||||||
note_type: $( 'select#order_note_type' ).val(),
|
note_type: $( 'select#order_note_type' ).val(),
|
||||||
security: woocommerce_admin_meta_boxes.add_order_note_nonce,
|
security: woocommerce_admin_meta_boxes.add_order_note_nonce
|
||||||
};
|
};
|
||||||
|
|
||||||
$.post( woocommerce_admin_meta_boxes.ajax_url, data, function( response ) {
|
$.post( woocommerce_admin_meta_boxes.ajax_url, data, function( response ) {
|
||||||
|
@ -1171,15 +1171,15 @@ jQuery( function ( $ ) {
|
||||||
var data = {
|
var data = {
|
||||||
action: 'woocommerce_delete_order_note',
|
action: 'woocommerce_delete_order_note',
|
||||||
note_id: $( note ).attr( 'rel' ),
|
note_id: $( note ).attr( 'rel' ),
|
||||||
security: woocommerce_admin_meta_boxes.delete_order_note_nonce,
|
security: woocommerce_admin_meta_boxes.delete_order_note_nonce
|
||||||
};
|
};
|
||||||
|
|
||||||
$.post( woocommerce_admin_meta_boxes.ajax_url, data, function( response ) {
|
$.post( woocommerce_admin_meta_boxes.ajax_url, data, function() {
|
||||||
$( note ).remove();
|
$( note ).remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1212,7 +1212,7 @@ jQuery( function ( $ ) {
|
||||||
product_ids: products,
|
product_ids: products,
|
||||||
loop: $('.order_download_permissions .wc-metabox').size(),
|
loop: $('.order_download_permissions .wc-metabox').size(),
|
||||||
order_id: woocommerce_admin_meta_boxes.post_id,
|
order_id: woocommerce_admin_meta_boxes.post_id,
|
||||||
security: woocommerce_admin_meta_boxes.grant_access_nonce,
|
security: woocommerce_admin_meta_boxes.grant_access_nonce
|
||||||
};
|
};
|
||||||
|
|
||||||
$.post( woocommerce_admin_meta_boxes.ajax_url, data, function( response ) {
|
$.post( woocommerce_admin_meta_boxes.ajax_url, data, function( response ) {
|
||||||
|
@ -1251,10 +1251,10 @@ jQuery( function ( $ ) {
|
||||||
product_id: product,
|
product_id: product,
|
||||||
download_id: file,
|
download_id: file,
|
||||||
order_id: woocommerce_admin_meta_boxes.post_id,
|
order_id: woocommerce_admin_meta_boxes.post_id,
|
||||||
security: woocommerce_admin_meta_boxes.revoke_access_nonce,
|
security: woocommerce_admin_meta_boxes.revoke_access_nonce
|
||||||
};
|
};
|
||||||
|
|
||||||
$.post( woocommerce_admin_meta_boxes.ajax_url, data, function ( response ) {
|
$.post( woocommerce_admin_meta_boxes.ajax_url, data, function() {
|
||||||
// Success
|
// Success
|
||||||
$( el ).fadeOut( '300', function () {
|
$( el ).fadeOut( '300', function () {
|
||||||
$( el ).remove();
|
$( el ).remove();
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue