Make WordPress Core

Changeset 24644


Ignore:
Timestamp:
07/10/2013 04:32:09 PM (13 years ago)
Author:
helen
Message:

Add sliding animations to the accordion. props kovshenin, DrewAPicture, helen. fixes #23890.

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/css/wp-admin.css

    r24631 r24644  
    88858885.no-js .accordion-section .accordion-section-content {
    88868886    display: block;
    8887     background: #fdfdfd;
    8888     border-left: 1px solid #dfdfdf;
    8889     border-right: 1px solid #dfdfdf;
    88908887}
    88918888
     
    88988895    padding: 10px 20px 15px;
    88998896    overflow: hidden;
     8897    background: #fdfdfd;
     8898    border-left: 1px solid #dfdfdf;
     8899    border-right: 1px solid #dfdfdf;
    89008900}
    89018901
  • trunk/wp-admin/js/accordion.js

    r23858 r24644  
    66        e.preventDefault(); // Keep this AFTER the key filter above
    77
    8         var section = $( this ).closest( '.accordion-section' );
     8        var section = $( this ).closest( '.accordion-section' ),
     9            siblings = section.siblings( '.open' ),
     10            content = section.find( '.accordion-section-content' );
    911
    1012        if ( section.hasClass('cannot-expand') )
    1113            return;
    1214
    13         section.siblings( '.open' ).removeClass( 'open' );
     15        siblings.removeClass( 'open' );
     16        siblings.find( '.accordion-section-content' ).show().slideUp( 150 );
     17        content.toggle( section.hasClass( 'open' ) ).slideToggle( 150 );
    1418        section.toggleClass( 'open' );
    1519    });
Note: See TracChangeset for help on using the changeset viewer.