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

see #24062

git-svn-id: https://develop.svn.wordpress.org/trunk@24088 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith 2013-04-25 05:58:55 +00:00
parent bab5ddd458
commit 77731b116b
1 changed files with 4 additions and 7 deletions

View File

@ -93,18 +93,15 @@ window.wp = window.wp || {};
}
// If gallery, force it to open to gallery state
if ( 'gallery' === format )
insertMediaButton.addClass( 'gallery' );
else
insertMediaButton.removeClass( 'gallery' );
insertMediaButton.toggleClass( 'gallery', 'gallery' === format );
postFormats.currentPostFormat = format;
}
postFormats.currentPostFormat = format;
}
$(function() {
insertMediaButton = $( '#insert-media-button' );
insertMediaButton = $( '#insert-media-button' ).toggleClass( 'gallery', 'gallery' === postFormats.currentPostFormat );
$container = $( '.post-formats-fields' );
initialFormat = $( '.post-format-options .active' ).data( 'wp-format' );