parent
f334760e0a
commit
ce82fcc0c7
|
@ -21,17 +21,7 @@ jQuery( function( $ ) {
|
||||||
return ui;
|
return ui;
|
||||||
},
|
},
|
||||||
start: function( event, ui ) {
|
start: function( event, ui ) {
|
||||||
ui.placeholder.children().each( function() {
|
|
||||||
var $original = ui.item.children().eq( ui.placeholder.children().index( this ) ),
|
|
||||||
$this = $( this );
|
|
||||||
|
|
||||||
$.each( $original[0].attributes, function( k, attr ) {
|
|
||||||
$this.attr( attr.name, attr.value );
|
|
||||||
});
|
|
||||||
});
|
|
||||||
if ( ! ui.item.hasClass( 'alternate' ) ) {
|
|
||||||
ui.item.css( 'background-color', '#ffffff' );
|
ui.item.css( 'background-color', '#ffffff' );
|
||||||
}
|
|
||||||
ui.item.children( 'td, th' ).css( 'border-bottom-width', '0' );
|
ui.item.children( 'td, th' ).css( 'border-bottom-width', '0' );
|
||||||
ui.item.css( 'outline', '1px solid #dfdfdf' );
|
ui.item.css( 'outline', '1px solid #dfdfdf' );
|
||||||
},
|
},
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
jQuery(function(a){a("table.widefat tbody th, table.widefat tbody td").css("cursor","move"),a("table.widefat tbody").sortable({items:"tr:not(.inline-edit-row)",cursor:"move",axis:"y",containment:"table.widefat",scrollSensitivity:40,helper:function(b,c){return c.each(function(){a(this).width(a(this).width())}),c},start:function(b,c){c.placeholder.children().each(function(){var b=c.item.children().eq(c.placeholder.children().index(this)),d=a(this);a.each(b[0].attributes,function(a,b){d.attr(b.name,b.value)})}),c.item.hasClass("alternate")||c.item.css("background-color","#ffffff"),c.item.children("td, th").css("border-bottom-width","0"),c.item.css("outline","1px solid #dfdfdf")},stop:function(a,b){b.item.removeAttr("style"),b.item.children("td,th").css("border-bottom-width","1px")},update:function(b,c){a("table.widefat tbody th, table.widefat tbody td").css("cursor","default"),a("table.widefat tbody").sortable("disable");var d=c.item.find(".check-column input").val(),e=c.item.prev().find(".check-column input").val(),f=c.item.next().find(".check-column input").val();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_product_ordering",id:d,previd:e,nextid:f},function(b){a.each(b,function(b,c){a("#inline_"+b+" .menu_order").html(c)}),c.item.find(".check-column input").show().siblings("img").remove(),a("table.widefat tbody th, table.widefat tbody td").css("cursor","move"),a("table.widefat tbody").sortable("enable")}),a("table.widefat tbody tr").each(function(){var b=a("table.widefat tbody tr").index(this);b%2===0?a(this).addClass("alternate"):a(this).removeClass("alternate")})}})});
|
jQuery(function(a){a("table.widefat tbody th, table.widefat tbody td").css("cursor","move"),a("table.widefat tbody").sortable({items:"tr:not(.inline-edit-row)",cursor:"move",axis:"y",containment:"table.widefat",scrollSensitivity:40,helper:function(b,c){return c.each(function(){a(this).width(a(this).width())}),c},start:function(a,b){b.item.css("background-color","#ffffff"),b.item.children("td, th").css("border-bottom-width","0"),b.item.css("outline","1px solid #dfdfdf")},stop:function(a,b){b.item.removeAttr("style"),b.item.children("td,th").css("border-bottom-width","1px")},update:function(b,c){a("table.widefat tbody th, table.widefat tbody td").css("cursor","default"),a("table.widefat tbody").sortable("disable");var d=c.item.find(".check-column input").val(),e=c.item.prev().find(".check-column input").val(),f=c.item.next().find(".check-column input").val();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_product_ordering",id:d,previd:e,nextid:f},function(b){a.each(b,function(b,c){a("#inline_"+b+" .menu_order").html(c)}),c.item.find(".check-column input").show().siblings("img").remove(),a("table.widefat tbody th, table.widefat tbody td").css("cursor","move"),a("table.widefat tbody").sortable("enable")}),a("table.widefat tbody tr").each(function(){var b=a("table.widefat tbody tr").index(this);b%2===0?a(this).addClass("alternate"):a(this).removeClass("alternate")})}})});
|
Loading…
Reference in New Issue