Merge pull request #18706 from woocommerce/update/uncategorized
Uncategorized tweaks
This commit is contained in:
commit
c28e2e2de5
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -2440,7 +2440,8 @@ table.wp-list-table {
|
|||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.column-handle {
|
||||
.column-handle,
|
||||
.column-nosort {
|
||||
width: 17px;
|
||||
}
|
||||
|
||||
|
|
|
@ -3,12 +3,19 @@
|
|||
/* Modifided script from the simple-page-ordering plugin */
|
||||
jQuery( function( $ ) {
|
||||
|
||||
$( 'table.widefat.wp-list-table tr' ).append(
|
||||
'<td class="column-handle"></td>'
|
||||
);
|
||||
var table_selector = 'table.wp-list-table',
|
||||
item_selector = 'tbody tr:not(.inline-edit-row, ' + '#tag-' + woocommerce_term_ordering_params.default + ')';
|
||||
|
||||
$( 'table.widefat.wp-list-table' ).sortable({
|
||||
items: 'tbody tr:not(.inline-edit-row)',
|
||||
$( 'table.wp-list-table tr:not(.inline-edit-row)' ).each( function() {
|
||||
if ( 'tag-' + woocommerce_term_ordering_params.default === $( this ).prop( 'id' ) ) {
|
||||
$( this ).append( '<td class="column-nosort"></td>' );
|
||||
} else {
|
||||
$( this ).append( '<td class="column-handle"></td>' );
|
||||
}
|
||||
} );
|
||||
|
||||
$( table_selector ).sortable({
|
||||
items: item_selector,
|
||||
cursor: 'move',
|
||||
handle: '.column-handle',
|
||||
axis: 'y',
|
||||
|
@ -53,7 +60,7 @@ jQuery( function( $ ) {
|
|||
|
||||
// If previous and next not at same tree level, or next not at same tree level and the previous is the parent of the next, or just moved item beneath its own children
|
||||
if ( ( prevtermid === undefined && nexttermid === undefined ) || ( nexttermid === undefined && nexttermparent === prevtermid ) || ( nexttermid !== undefined && prevtermparent === termid ) ) {
|
||||
$( 'table.widefat.wp-list-table' ).sortable( 'cancel' );
|
||||
$( table_selector ).sortable( 'cancel' );
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -328,6 +328,7 @@ class WC_Admin_Assets {
|
|||
|
||||
$woocommerce_term_order_params = array(
|
||||
'taxonomy' => $taxonomy,
|
||||
'default' => absint( get_option( 'default_product_cat' ) ),
|
||||
);
|
||||
|
||||
wp_localize_script( 'woocommerce_term_ordering', 'woocommerce_term_ordering_params', $woocommerce_term_order_params );
|
||||
|
|
|
@ -1854,6 +1854,7 @@ if ( ! function_exists( 'woocommerce_get_product_subcategories' ) ) {
|
|||
'hierarchical' => 1,
|
||||
'taxonomy' => 'product_cat',
|
||||
'pad_counts' => 1,
|
||||
'exclude' => get_option( 'default_product_cat' ),
|
||||
) ) );
|
||||
wp_cache_set( 'product-categories-' . $parent_id, $product_categories, 'product_cat' );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue