| Server IP : 146.59.209.152 / Your IP : 216.73.216.152 Web Server : Apache System : Linux webm009.cluster131.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64 User : monpetu ( 144298) PHP Version : 7.4.33 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/monpetu/www/ipprint/wp-content/plugins/order-tracking/lib/simple-admin-pages/js/ |
Upload File : |
/**
* Javascript functions for Ordering Table
*
* @package Simple Admin Pages
*/
jQuery(document).ready(function ($) {
// process fields
$('.sap-parent-form').on('submit', function (ev) {
var _form = $(this), ignore;
$('.sap-ordering-table').each( function() {
var main_input = $(this).find('#sap-ordering-table-main-input');
var main_input_val = {};
$(this).find('table tbody tr').each((idx_tr, tr) => {
$(tr).find('td').each((idx_td, td) => {
let elm = $(td).find('input');
main_input_val[elm.val()] = $(td).find('span').html();
});
});
if ( Object.keys( main_input_val ).length ) { main_input.val( JSON.stringify( main_input_val ) ); }
});
});
$('.sap-ordering-table table tbody').sortable({
axis: 'y'
});
//reset field to default
$( '.sap-ordering-table-restore-default' ).on( 'click', function() {
var table_div = jQuery( this ).closest( '.sap-ordering-table' );
table_div.find( '#sap-ordering-table-main-input' ).first().val( '' );
table_div.find( 'table tbody tr' ).remove();
table_div.find( 'table' ).append( '<tfoot><tr><td>Save the page to restore the default order</td></tr></tfoot>' );
} );
})