WordPress/wp-admin/js/accordion.min.js
Bot (Assets) e66153a110 Compress scripts/styles: 3.6-RC1-24737.
git-svn-id: http://core.svn.wordpress.org/trunk@24737 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-07-18 18:58:49 +00:00

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);