woocommerce/assets/js/admin/settings.min.js

1 line
1.7 KiB
JavaScript
Raw Normal View History

2015-07-10 23:17:47 +00:00
jQuery(window).load(function(){jQuery("select#woocommerce_allowed_countries, select#woocommerce_ship_to_countries").change(function(){"specific"===jQuery(this).val()?jQuery(this).parent().parent().next("tr").show():jQuery(this).parent().parent().next("tr").hide()}).change(),jQuery(".colorpick").iris({change:function(a,b){jQuery(this).parent().find(".colorpickpreview").css({backgroundColor:b.color.toString()})},hide:!0,border:!0}).click(function(){jQuery(".iris-picker").hide(),jQuery(this).closest("td").find(".iris-picker").show()}),jQuery("body").click(function(){jQuery(".iris-picker").hide()}),jQuery(".colorpick").click(function(a){a.stopPropagation()}),jQuery(function(){var a=!1;jQuery("input, textarea, select, checkbox").change(function(){a=!0}),jQuery(".woo-nav-tab-wrapper a").click(function(){a?window.onbeforeunload=function(){return woocommerce_settings_params.i18n_nav_warning}:window.onbeforeunload=""}),jQuery(".submit input").click(function(){window.onbeforeunload=""})}),jQuery("table.wc_gateways tbody, table.wc_shipping tbody").sortable({items:"tr",cursor:"move",axis:"y",handle:"td.sort",scrollSensitivity:40,helper:function(a,b){return b.children().each(function(){jQuery(this).width(jQuery(this).width())}),b.css("left","0"),b},start:function(a,b){b.item.css("background-color","#f6f6f6")},stop:function(a,b){b.item.removeAttr("style")}}),jQuery(".woocommerce").on("click",".select_all",function(){return jQuery(this).closest("td").find("select option").attr("selected","selected"),jQuery(this).closest("td").find("select").trigger("change"),!1}),jQuery(".woocommerce").on("click",".select_none",function(){return jQuery(this).closest("td").find("select option").removeAttr("selected"),jQuery(this).closest("td").find("select").trigger("change"),!1})});