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

see #24062

git-svn-id: http://core.svn.wordpress.org/trunk@24088 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Mark Jaquith 2013-04-25 05:58:55 +00:00
parent 1f6d2f796a
commit 601c0c2e52

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' );