39 lines
1.1 KiB
JavaScript
39 lines
1.1 KiB
JavaScript
jQuery(document).ready(function ($) {
|
|
$('.wiaas_delivery_step_nav').click(function (e) {
|
|
var action = $(this).data('step');
|
|
|
|
$('#wiaas_delivery_process_navigation_action').val(action);
|
|
|
|
});
|
|
|
|
$('#wiaas_delivery_process_add_note').click(function(e) {
|
|
if ( ! $( 'textarea#wiaas_add_order_note' ).val() ) {
|
|
return;
|
|
}
|
|
|
|
$( '#wiaas_delivery_process_order_notes' ).block({
|
|
message: null,
|
|
overlayCSS: {
|
|
background: '#fff',
|
|
opacity: 0.6
|
|
}
|
|
});
|
|
|
|
var data = {
|
|
action: 'wiaas_add_order_note',
|
|
post_id: $( 'textarea#wiaas_add_order_note' ).data('order-id'),
|
|
note: $( 'textarea#wiaas_add_order_note' ).val(),
|
|
security: $( 'textarea#wiaas_add_order_note' ).data('nonce'),
|
|
};
|
|
|
|
|
|
$.post( ajaxurl, data, function( response ) {
|
|
$( '#delivery_process_order_notes_list' ).prepend( response );
|
|
$( '#wiaas_delivery_process_order_notes' ).unblock();
|
|
$( '#wiaas_add_order_note' ).val( '' );
|
|
});
|
|
|
|
return false;
|
|
});
|
|
});
|