woocommerce/assets/js/frontend/woocommerce.min.js

1 line
1.3 KiB
JavaScript
Raw Normal View History

jQuery(function(e){e(".woocommerce-ordering").on("change","select.orderby",function(){e(this).closest("form").submit()}),e("input.qty:not(.product-quantity input.qty)").each(function(){var o=parseFloat(e(this).attr("min"));o>=0&&parseFloat(e(this).val())<o&&e(this).val(o)}),e(".woocommerce-store-notice__dismiss-link").click(function(){Cookies.set("store_notice","hidden",{path:"/"}),e(".woocommerce-store-notice").hide()}),"hidden"===Cookies.get("store_notice")?e(".woocommerce-store-notice").hide():e(".woocommerce-store-notice").show(),e(document.body).on("click",function(){e(".woocommerce-input-wrapper span.description:visible").prop("aria-hidden",!0).slideUp(250)}),e(".woocommerce-input-wrapper").on("click",function(e){e.stopPropagation()}),e(".woocommerce-input-wrapper :input").on("keydown",function(o){var i=e(this).parent().find("span.description");if(27===o.which&&i.length&&i.is(":visible"))return i.prop("aria-hidden",!0).slideUp(250),o.preventDefault(),!1}).on("focus",function(){var o=e(this).parent(),i=o.find("span.description");o.addClass("currentTarget"),e(".woocommerce-input-wrapper:not(.currentTarget) span.description:visible").prop("aria-hidden",!0).slideUp(250),i.length&&i.is(":hidden")&&i.prop("aria-hidden",!1).slideDown(250),o.removeClass("currentTarget")})});