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.

Built from https://develop.svn.wordpress.org/trunk@31343


git-svn-id: http://core.svn.wordpress.org/trunk@31324 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Helen Hou-Sandí 2015-02-05 20:12:22 +00:00
parent 6c45fe1cac
commit fa053ea65b
3 changed files with 4 additions and 5 deletions

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() {

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.2-alpha-31342';
$wp_version = '4.2-alpha-31343';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.