WordPress/wp-admin/js/accordion.min.js

1 line
857 B
JavaScript

(function(e){e(document).ready(function(){e(".accordion-container").on("click keydown",".accordion-section-title",function(f){if(f.type==="keydown"&&13!==f.which){return}f.preventDefault();a(e(this))});e(".hide-postbox-tog").click(function(){d()})});var b=e(".accordion-container li.accordion-section"),c=e(".accordion-section-content");function d(){b.removeClass("top bottom");b.filter(":visible").first().addClass("top");b.filter(":visible").last().addClass("bottom").find(c).addClass("bottom")}function a(f){var h=f.closest(".accordion-section"),i=h.closest(".accordion-container").find(".open"),g=h.find(c);if(h.hasClass("cannot-expand")){return}if(h.hasClass("open")){h.toggleClass("open");g.toggle(true).slideToggle(150)}else{i.removeClass("open");i.find(c).show().slideUp(150);g.toggle(false).slideToggle(150);h.toggleClass("open")}d()}d()})(jQuery);