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

1 line
814 B
JavaScript

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