TinyMCE wpView: update the "update" method. Props iseulde. See #31412.

git-svn-id: https://develop.svn.wordpress.org/trunk@31586 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2015-02-27 22:28:58 +00:00
parent dc6246a548
commit eb28f78cd3

View File

@ -648,9 +648,17 @@ window.wp = window.wp || {};
* @param {HTMLElement} node The view node to update. * @param {HTMLElement} node The view node to update.
*/ */
update: function( text, editor, node ) { update: function( text, editor, node ) {
$( node ).data( 'rendered', false ); _.find( views, function( view, type ) {
editor.dom.setAttrib( node, 'data-wpview-text', encodeURIComponent( text ) ); var match = view.prototype.match( text );
wp.mce.views.createInstance( this.type, text, this.match( text ).options ).render();
if ( match ) {
$( node ).data( 'rendered', false );
editor.dom.setAttrib( node, 'data-wpview-text', encodeURIComponent( text ) );
wp.mce.views.createInstance( type, text, match.options ).render();
return true;
}
} );
}, },
/** /**