mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-15 23:25:50 +01:00
e66153a110
git-svn-id: http://core.svn.wordpress.org/trunk@24737 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 line
857 B
JavaScript
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); |