Poprawa formatowania kodu w pliku listy produktów oraz dodanie obsługi aktualnej strony w paginacji

This commit is contained in:
2025-02-11 23:17:09 +01:00
parent 296fa6f315
commit afc7c4cc6a

View File

@@ -851,16 +851,19 @@
data = jQuery.parseJSON( response ); data = jQuery.parseJSON( response );
if ( data.status == 'ok' ) { if ( data.status == 'ok' )
{
$( '#table-products tbody' ).html( data.html ); $( '#table-products tbody' ).html( data.html );
$( '.pagination .previous' ).attr( 'page', ( current_page - 1 > 1 ) ? ( current_page - 1 ) : 1 ); $( '.pagination .previous' ).attr( 'page', ( current_page - 1 > 1 ) ? ( current_page - 1 ) : 1 );
$( '.pagination .next' ).attr( 'page', ( current_page + 1 < pagination_max ) ? ( current_page + 1 ) : pagination_max ); $( '.pagination .next' ).attr( 'page', ( current_page + 1 < pagination_max ) ? ( current_page + 1 ) : pagination_max );
$( '.pagination span' ).html( current_page ); $( '.pagination span' ).html( current_page );
if ( data.pagination_max ) { if ( data.pagination_max )
{
$( '.pagination' ).attr( 'pagination_max', data.pagination_max ); $( '.pagination' ).attr( 'pagination_max', data.pagination_max );
$( '.pagination #max_page' ).html( data.pagination_max ); $( '.pagination #max_page' ).html( data.pagination_max );
$( '.pagination .last' ).attr( 'page', data.pagination_max ); $( '.pagination .last' ).attr( 'page', data.pagination_max );
} }
$( '#current-page' ).val( current_page );
} }
} }
}); });