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

1 line
2.0 KiB
JavaScript

jQuery(window).load(function(){jQuery("select#woocommerce_allowed_countries, select#woocommerce_ship_to_countries").change(function(){jQuery(this).val()=="specific"?jQuery(this).parent().parent().next("tr").show():jQuery(this).parent().parent().next("tr").hide()}).change();jQuery(".colorpick").iris({change:function(e,t){jQuery(this).css({backgroundColor:t.color.toString()})},hide:!0,border:!0}).each(function(){jQuery(this).css({backgroundColor:jQuery(this).val()})}).click(function(){jQuery(".iris-picker").hide();jQuery(this).closest(".color_box, td").find(".iris-picker").show()});jQuery("body").click(function(){jQuery(".iris-picker").hide()});jQuery(".color_box, .colorpick").click(function(e){e.stopPropagation()});jQuery(function(){var e=!1;jQuery("input, textarea, select, checkbox").change(function(){e=!0});jQuery(".woo-nav-tab-wrapper a").click(function(){e?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",scrollSensitivity:40,helper:function(e,t){t.children().each(function(){jQuery(this).width(jQuery(this).width())});t.css("left","0");return t},start:function(e,t){t.item.css("background-color","#f6f6f6")},stop:function(e,t){t.item.removeAttr("style")}});jQuery("select.chosen_select").chosen({width:"350px",disable_search_threshold:5});jQuery("select.chosen_select_nostd").chosen({allow_single_deselect:"true",width:"350px",disable_search_threshold:5});jQuery(".select_all").live("click",function(){jQuery(this).closest("td").find("select option").attr("selected","selected");jQuery(this).closest("td").find("select").trigger("chosen:updated");return!1});jQuery(".select_none").live("click",function(){jQuery(this).closest("td").find("select option").removeAttr("selected");jQuery(this).closest("td").find("select").trigger("chosen:updated");return!1})});