Poprawa formatowania kodu w pliku products-list.php oraz dodanie ustawienia bieżącej strony w formularzu paginacji

This commit is contained in:
2025-02-11 23:17:19 +01:00
parent 6621eb8d40
commit 03434ff3e3

View File

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