Merge pull request #3989 from scottbasgaard/master

Use minified quick-edit.js
This commit is contained in:
Mike Jolley 2013-10-23 08:38:49 -07:00
commit 9b07853b66
2 changed files with 2 additions and 2 deletions

View File

@ -1 +1 @@
jQuery(document).ready(function(){jQuery("#the-list").on("click",".editinline",function(){inlineEditPost.revert();var e=jQuery(this).closest("tr").attr("id");e=e.replace("post-","");var t=jQuery("#woocommerce_inline_"+e),n=t.find(".sku").text(),r=t.find(".regular_price").text(),i=t.find(".sale_price").text(),s=t.find(".weight").text(),o=t.find(".length").text(),u=t.find(".width").text(),a=t.find(".height").text(),f=t.find(".visibility").text(),l=t.find(".stock_status").text(),c=t.find(".stock").text(),h=t.find(".featured").text(),p=t.find(".manage_stock").text(),d=t.find(".menu_order").text(),v=t.find(".tax_status").text(),m=t.find(".tax_class").text(),g=t.find(".backorders").text();jQuery('input[name="_sku"]',".inline-edit-row").val(n);jQuery('input[name="_regular_price"]',".inline-edit-row").val(r);jQuery('input[name="_sale_price"]',".inline-edit-row").val(i);jQuery('input[name="_weight"]',".inline-edit-row").val(s);jQuery('input[name="_length"]',".inline-edit-row").val(o);jQuery('input[name="_width"]',".inline-edit-row").val(u);jQuery('input[name="_height"]',".inline-edit-row").val(a);jQuery('input[name="_stock"]',".inline-edit-row").val(c);jQuery('input[name="menu_order"]',".inline-edit-row").val(d);jQuery('select[name="_tax_status"] option[value="'+v+'"]',".inline-edit-row").attr("selected","selected");jQuery('select[name="_tax_class"] option[value="'+m+'"]',".inline-edit-row").attr("selected","selected");jQuery('select[name="_visibility"] option, select[name="_stock_status"] option, select[name="_backorders"] option').removeAttr("selected");jQuery('select[name="_visibility"] option[value="'+f+'"]',".inline-edit-row").attr("selected","selected");jQuery('select[name="_stock_status"] option[value="'+l+'"]',".inline-edit-row").attr("selected","selected");jQuery('select[name="_backorders"] option[value="'+g+'"]',".inline-edit-row").attr("selected","selected");h=="yes"?jQuery('input[name="_featured"]',".inline-edit-row").attr("checked","checked"):jQuery('input[name="_featured"]',".inline-edit-row").removeAttr("checked");if(p=="yes"){jQuery(".stock_qty_field",".inline-edit-row").show().removeAttr("style");jQuery('input[name="_manage_stock"]',".inline-edit-row").attr("checked","checked")}else{jQuery(".stock_qty_field",".inline-edit-row").hide();jQuery('input[name="_manage_stock"]',".inline-edit-row").removeAttr("checked")}var y=t.find(".product_type").text(),b=t.find(".product_is_virtual").text();y=="simple"||y=="external"?jQuery(".price_fields",".inline-edit-row").show().removeAttr("style"):jQuery(".price_fields",".inline-edit-row").hide();b=="yes"?jQuery(".dimension_fields",".inline-edit-row").hide():jQuery(".dimension_fields",".inline-edit-row").show().removeAttr("style");y=="grouped"?jQuery(".stock_fields",".inline-edit-row").hide():jQuery(".stock_fields",".inline-edit-row").show().removeAttr("style")});jQuery("#the-list").on("change",'.inline-edit-row input[name="_manage_stock"]',function(){jQuery(this).is(":checked")?jQuery(".stock_qty_field",".inline-edit-row").show().removeAttr("style"):jQuery(".stock_qty_field",".inline-edit-row").hide()});jQuery("#wpbody").on("click","#doaction, #doaction2",function(){jQuery("input.text",".inline-edit-row").val("");jQuery("#woocommerce-fields select").prop("selectedIndex",0);jQuery("#woocommerce-fields-bulk .inline-edit-group .alignright").hide()});jQuery("#wpbody").on("change","#woocommerce-fields-bulk .inline-edit-group .change_to",function(){jQuery(this).val()>0?jQuery(this).closest("div").find(".alignright").show():jQuery(this).closest("div").find(".alignright").hide()});jQuery(".product_shipping_class-checklist input").change(function(){jQuery(this).closest("li").siblings().find("input:checked").removeAttr("checked")})});
jQuery(document).ready(function(){jQuery("#the-list").on("click",".editinline",function(){inlineEditPost.revert();var e=jQuery(this).closest("tr").attr("id");e=e.replace("post-","");var t=jQuery("#woocommerce_inline_"+e);var n=t.find(".sku").text();var r=t.find(".regular_price").text();var i=t.find(".sale_price").text();var s=t.find(".weight").text();var o=t.find(".length").text();var u=t.find(".width").text();var a=t.find(".height").text();var f=t.find(".visibility").text();var l=t.find(".stock_status").text();var c=t.find(".stock").text();var h=t.find(".featured").text();var p=t.find(".manage_stock").text();var d=t.find(".menu_order").text();var v=t.find(".tax_status").text();var m=t.find(".tax_class").text();var g=t.find(".backorders").text();jQuery('input[name="_sku"]',".inline-edit-row").val(n);jQuery('input[name="_regular_price"]',".inline-edit-row").val(r);jQuery('input[name="_sale_price"]',".inline-edit-row").val(i);jQuery('input[name="_weight"]',".inline-edit-row").val(s);jQuery('input[name="_length"]',".inline-edit-row").val(o);jQuery('input[name="_width"]',".inline-edit-row").val(u);jQuery('input[name="_height"]',".inline-edit-row").val(a);jQuery('input[name="_stock"]',".inline-edit-row").val(c);jQuery('input[name="menu_order"]',".inline-edit-row").val(d);jQuery('select[name="_tax_status"] option[value="'+v+'"]',".inline-edit-row").attr("selected","selected");jQuery('select[name="_tax_class"] option[value="'+m+'"]',".inline-edit-row").attr("selected","selected");jQuery('select[name="_visibility"] option, select[name="_stock_status"] option, select[name="_backorders"] option').removeAttr("selected");jQuery('select[name="_visibility"] option[value="'+f+'"]',".inline-edit-row").attr("selected","selected");jQuery('select[name="_stock_status"] option[value="'+l+'"]',".inline-edit-row").attr("selected","selected");jQuery('select[name="_backorders"] option[value="'+g+'"]',".inline-edit-row").attr("selected","selected");if(h=="yes"){jQuery('input[name="_featured"]',".inline-edit-row").attr("checked","checked")}else{jQuery('input[name="_featured"]',".inline-edit-row").removeAttr("checked")}if(p=="yes"){jQuery(".stock_qty_field",".inline-edit-row").show().removeAttr("style");jQuery('input[name="_manage_stock"]',".inline-edit-row").attr("checked","checked")}else{jQuery(".stock_qty_field",".inline-edit-row").hide();jQuery('input[name="_manage_stock"]',".inline-edit-row").removeAttr("checked")}var y=t.find(".product_type").text();var b=t.find(".product_is_virtual").text();if(y=="simple"||y=="external"){jQuery(".price_fields",".inline-edit-row").show().removeAttr("style")}else{jQuery(".price_fields",".inline-edit-row").hide()}if(b=="yes"){jQuery(".dimension_fields",".inline-edit-row").hide()}else{jQuery(".dimension_fields",".inline-edit-row").show().removeAttr("style")}if(y=="grouped"){jQuery(".stock_fields",".inline-edit-row").hide()}else{jQuery(".stock_fields",".inline-edit-row").show().removeAttr("style")}});jQuery("#the-list").on("change",'.inline-edit-row input[name="_manage_stock"]',function(){if(jQuery(this).is(":checked")){jQuery(".stock_qty_field",".inline-edit-row").show().removeAttr("style")}else{jQuery(".stock_qty_field",".inline-edit-row").hide()}});jQuery("#wpbody").on("click","#doaction, #doaction2",function(){jQuery("input.text",".inline-edit-row").val("");jQuery("#woocommerce-fields select").prop("selectedIndex",0);jQuery("#woocommerce-fields-bulk .inline-edit-group .alignright").hide()});jQuery("#wpbody").on("change","#woocommerce-fields-bulk .inline-edit-group .change_to",function(){if(jQuery(this).val()>0){jQuery(this).closest("div").find(".alignright").show()}else{jQuery(this).closest("div").find(".alignright").hide()}});jQuery(".product_shipping_class-checklist input").change(function(){jQuery(this).closest("li").siblings().find("input:checked").removeAttr("checked")})})

View File

@ -110,7 +110,7 @@ class WC_Admin_Assets {
// Products
if ( in_array( $screen->id, array( 'edit-product' ) ) )
wp_enqueue_script( 'woocommerce_quick-edit', $woocommerce->plugin_url() . '/assets/js/admin/quick-edit.js', array('jquery') );
wp_enqueue_script( 'woocommerce_quick-edit', $woocommerce->plugin_url() . '/assets/js/admin/quick-edit' . $suffix . '.js', array('jquery'), $woocommerce->version );
// Product/Coupon/Orders
if ( in_array( $screen->id, array( 'shop_coupon', 'shop_order', 'product', 'edit-shop_coupon', 'edit-shop_order', 'edit-product' ) ) ) {