Begin to handle pagination.
This lets the initial view display only a single page, future commits will add in the paginater.
This commit is contained in:
parent
2b2a54c5dc
commit
f541093dce
|
@ -40,8 +40,19 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
renderTableContents( data.rates );
|
/**
|
||||||
|
* Handle the initial display.
|
||||||
|
*/
|
||||||
|
if ( data.rates.length <= data.limit ) {
|
||||||
|
renderTableContents( data.rates );
|
||||||
|
} else {
|
||||||
|
var first_index = data.limit * ( data.page - 1),
|
||||||
|
last_index = data.limit * data.page;
|
||||||
|
|
||||||
|
renderTableContents( data.rates.slice( first_index, last_index ) );
|
||||||
|
|
||||||
|
// We've now displayed our initial page, time to render the pagination box.
|
||||||
|
}
|
||||||
|
|
||||||
$('.wc_tax_rates .remove_tax_rates').click(function() {
|
$('.wc_tax_rates .remove_tax_rates').click(function() {
|
||||||
if ( $tbody.find('tr.current').length > 0 ) {
|
if ( $tbody.find('tr.current').length > 0 ) {
|
||||||
|
|
Loading…
Reference in New Issue