MCE views: Always refresh the view after updating a gallery.

This allows things like caption changes to be synced, as they are tied to the attachment and not the shortcode.

props iseulde.
fixes #31239.


git-svn-id: https://develop.svn.wordpress.org/trunk@31343 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Helen Hou-Sandi 2015-02-05 20:11:04 +00:00
parent 90947c2c45
commit cdbea14c09

View File

@ -558,10 +558,9 @@ window.wp = window.wp || {};
frame = gallery.edit( data );
frame.state('gallery-edit').on( 'update', function( selection ) {
var shortcode = gallery.shortcode( selection ).string(), force;
var shortcode = gallery.shortcode( selection ).string();
$( node ).attr( 'data-wpview-text', window.encodeURIComponent( shortcode ) );
force = ( data !== shortcode );
wp.mce.views.refreshView( self, shortcode, force );
wp.mce.views.refreshView( self, shortcode, true );
});
frame.on( 'close', function() {