mirror of
https://github.com/WordPress/WordPress.git
synced 2024-08-19 20:33:00 +02:00
props afercia, celloexpressions, westonruter. fixes #32715. Built from https://develop.svn.wordpress.org/trunk@33413 git-svn-id: http://core.svn.wordpress.org/trunk@33381 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 line
758 B
JavaScript
1 line
758 B
JavaScript
!function(a){function b(a){var b=a.closest(".accordion-section"),c=b.find("[aria-expanded]").first(),d=b.closest(".accordion-container").find(".open"),e=d.find("[aria-expanded]").first(),f=b.find(".accordion-section-content");b.hasClass("cannot-expand")||(b.hasClass("open")?(b.toggleClass("open"),f.toggle(!0).slideToggle(150)):(e.attr("aria-expanded","false"),d.removeClass("open"),d.find(".accordion-section-content").show().slideUp(150),f.toggle(!1).slideToggle(150),b.toggleClass("open")),c&&c.attr("aria-expanded",String("false"===c.attr("aria-expanded"))))}a(document).ready(function(){a(".accordion-container").on("click keydown",".accordion-section-title",function(c){("keydown"!==c.type||13===c.which)&&(c.preventDefault(),b(a(this)))})})}(jQuery); |