WordPress.org

Make WordPress Core

Changeset 24088


Ignore:
Timestamp:
04/25/13 05:58:55 (2 years ago)
Author:
markjaquith
Message:

Clean up gallery-mode toggling in post-formats.js and make sure it is set on first load.

see #24062

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/js/post-formats.js

    r24087 r24088  
    9494 
    9595        // If gallery, force it to open to gallery state 
    96         if ( 'gallery' === format ) 
    97             insertMediaButton.addClass( 'gallery' ); 
    98         else 
    99             insertMediaButton.removeClass( 'gallery' ); 
    100  
    101             postFormats.currentPostFormat = format; 
    102         } 
     96        insertMediaButton.toggleClass( 'gallery', 'gallery' === format ); 
     97 
     98        postFormats.currentPostFormat = format; 
     99    } 
    103100 
    104101 
    105102 
    106103    $(function() { 
    107         insertMediaButton = $( '#insert-media-button' ); 
     104        insertMediaButton = $( '#insert-media-button' ).toggleClass( 'gallery', 'gallery' === postFormats.currentPostFormat ); 
    108105        $container = $( '.post-formats-fields' ); 
    109106 
Note: See TracChangeset for help on using the changeset viewer.