From cdbea14c090bb527d5b59be32e40060432af2337 Mon Sep 17 00:00:00 2001 From: Helen Hou-Sandi Date: Thu, 5 Feb 2015 20:11:04 +0000 Subject: [PATCH] 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 --- src/wp-includes/js/mce-view.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/wp-includes/js/mce-view.js b/src/wp-includes/js/mce-view.js index da1ce6aed2..209a7b9e20 100644 --- a/src/wp-includes/js/mce-view.js +++ b/src/wp-includes/js/mce-view.js @@ -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() {