Add handles so drag and drop does not break edit on mobile
Fixes #15118
This commit is contained in:
parent
cac5b33553
commit
c3c966b5fd
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -2058,6 +2058,31 @@ table.wp-list-table {
|
|||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.column-handle {
|
||||
width: 17px;
|
||||
}
|
||||
|
||||
tbody {
|
||||
td.column-handle {
|
||||
cursor: move;
|
||||
width: 17px;
|
||||
text-align: center;
|
||||
vertical-align: text-top;
|
||||
|
||||
&::before {
|
||||
content: '\f333';
|
||||
font-family: 'Dashicons';
|
||||
text-align: center;
|
||||
line-height: 1;
|
||||
color: #999;
|
||||
display: block;
|
||||
width: 17px;
|
||||
height: 100%;
|
||||
margin: 4px 0 0 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.column-name {
|
||||
width: 22%;
|
||||
}
|
||||
|
|
|
@ -3,11 +3,14 @@
|
|||
/* Modifided script from the simple-page-ordering plugin */
|
||||
jQuery( function( $ ) {
|
||||
|
||||
$( 'table.widefat.wp-list-table tbody th, table.widefat tbody td' ).css( 'cursor', 'move' );
|
||||
$( 'table.widefat.wp-list-table tr' ).append(
|
||||
'<td class="column-handle"></td>'
|
||||
);
|
||||
|
||||
$( 'table.widefat.wp-list-table' ).sortable({
|
||||
items: 'tbody tr:not(.inline-edit-row)',
|
||||
cursor: 'move',
|
||||
handle: '.column-handle',
|
||||
axis: 'y',
|
||||
forcePlaceholderSize: true,
|
||||
helper: 'clone',
|
||||
|
|
|
@ -1 +1 @@
|
|||
jQuery(function(a){a("table.widefat.wp-list-table tbody th, table.widefat tbody td").css("cursor","move"),a("table.widefat.wp-list-table").sortable({items:"tbody tr:not(.inline-edit-row)",cursor:"move",axis:"y",forcePlaceholderSize:!0,helper:"clone",opacity:.65,placeholder:"product-cat-placeholder",scrollSensitivity:40,start:function(a,b){b.item.hasClass("alternate")||b.item.css("background-color","#ffffff"),b.item.children("td, th").css("border-bottom-width","0"),b.item.css("outline","1px solid #aaa")},stop:function(a,b){b.item.removeAttr("style"),b.item.children("td, th").css("border-bottom-width","1px")},update:function(b,c){var d,e,f=c.item.find(".check-column input").val(),g=c.item.find(".parent").html(),h=c.item.prev().find(".check-column input").val(),i=c.item.next().find(".check-column input").val();return void 0!==h&&(d=c.item.prev().find(".parent").html(),d!==g&&(h=void 0)),void 0!==i&&(e=c.item.next().find(".parent").html(),e!==g&&(i=void 0)),void 0===h&&void 0===i||void 0===i&&e===h||void 0!==i&&d===f?void a("table.widefat.wp-list-table").sortable("cancel"):(c.item.find(".check-column input").hide().after('<img alt="processing" src="images/wpspin_light.gif" class="waiting" style="margin-left: 6px;" />'),a.post(ajaxurl,{action:"woocommerce_term_ordering",id:f,nextid:i,thetaxonomy:woocommerce_term_ordering_params.taxonomy},function(a){"children"===a?window.location.reload():c.item.find(".check-column input").show().siblings("img").remove()}),void a("table.widefat tbody tr").each(function(){var a=jQuery("table.widefat tbody tr").index(this);a%2===0?jQuery(this).addClass("alternate"):jQuery(this).removeClass("alternate")}))}})});
|
||||
jQuery(function(a){a("table.widefat.wp-list-table tr").append('<td class="column-handle"></td>'),a("table.widefat.wp-list-table").sortable({items:"tbody tr:not(.inline-edit-row)",cursor:"move",handle:".column-handle",axis:"y",forcePlaceholderSize:!0,helper:"clone",opacity:.65,placeholder:"product-cat-placeholder",scrollSensitivity:40,start:function(a,b){b.item.hasClass("alternate")||b.item.css("background-color","#ffffff"),b.item.children("td, th").css("border-bottom-width","0"),b.item.css("outline","1px solid #aaa")},stop:function(a,b){b.item.removeAttr("style"),b.item.children("td, th").css("border-bottom-width","1px")},update:function(b,c){var d,e,f=c.item.find(".check-column input").val(),g=c.item.find(".parent").html(),h=c.item.prev().find(".check-column input").val(),i=c.item.next().find(".check-column input").val();return void 0!==h&&(d=c.item.prev().find(".parent").html(),d!==g&&(h=void 0)),void 0!==i&&(e=c.item.next().find(".parent").html(),e!==g&&(i=void 0)),void 0===h&&void 0===i||void 0===i&&e===h||void 0!==i&&d===f?void a("table.widefat.wp-list-table").sortable("cancel"):(c.item.find(".check-column input").hide().after('<img alt="processing" src="images/wpspin_light.gif" class="waiting" style="margin-left: 6px;" />'),a.post(ajaxurl,{action:"woocommerce_term_ordering",id:f,nextid:i,thetaxonomy:woocommerce_term_ordering_params.taxonomy},function(a){"children"===a?window.location.reload():c.item.find(".check-column input").show().siblings("img").remove()}),void a("table.widefat tbody tr").each(function(){var a=jQuery("table.widefat tbody tr").index(this);a%2===0?jQuery(this).addClass("alternate"):jQuery(this).removeClass("alternate")}))}})});
|
|
@ -44,6 +44,12 @@ function wc_get_screen_ids() {
|
|||
$screen_ids[] = 'edit-' . $type;
|
||||
}
|
||||
|
||||
if ( $attributes = wc_get_attribute_taxonomies() ) {
|
||||
foreach ( $attributes as $attribute ) {
|
||||
$screen_ids[] = 'edit-' . wc_attribute_taxonomy_name( $attribute->attribute_name );
|
||||
}
|
||||
}
|
||||
|
||||
return apply_filters( 'woocommerce_screen_ids', $screen_ids );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue