New template for empty set.
This commit is contained in:
parent
4e2229a6bf
commit
f77b77e335
|
@ -13,6 +13,7 @@
|
|||
}
|
||||
|
||||
var rowTemplate = wp.template( 'wc-tax-table-row' ),
|
||||
rowTemplateEmpty = wp.template( 'wc-tax-table-row-empty' ),
|
||||
paginationTemplate = wp.template( 'wc-tax-table-pagination' ),
|
||||
$table = $( '.wc_tax_rates' ),
|
||||
$tbody = $( '#rates' ),
|
||||
|
@ -64,10 +65,14 @@
|
|||
// Blank out the contents.
|
||||
this.$el.empty();
|
||||
|
||||
// Populate $tbody with the current page of results.
|
||||
$.each( paged_rates, function ( id, rowData ) {
|
||||
view.$el.append( view.rowTemplate( rowData ) );
|
||||
});
|
||||
if ( paged_rates.length ) {
|
||||
// Populate $tbody with the current page of results.
|
||||
$.each( paged_rates, function ( id, rowData ) {
|
||||
view.$el.append( view.rowTemplate( rowData ) );
|
||||
} );
|
||||
} else {
|
||||
view.$el.append( rowTemplateEmpty() );
|
||||
}
|
||||
|
||||
// Initialize autocomplete for countries.
|
||||
this.$el.find( 'td.country input' ).autocomplete({
|
||||
|
|
|
@ -93,6 +93,12 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
</tr>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="tmpl-wc-tax-table-row-empty">
|
||||
<tr>
|
||||
<th colspan="10" style="text-align:center"><?php esc_html_e( 'No Matching Tax Rates Found.', 'woocommerce' ); ?></th>
|
||||
</tr>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="tmpl-wc-tax-table-pagination">
|
||||
<div class="tablenav">
|
||||
<div class="tablenav-pages">
|
||||
|
|
Loading…
Reference in New Issue