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

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


git-svn-id: http://core.svn.wordpress.org/trunk@31567 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2015-02-27 22:29:26 +00:00
parent 7acfb7740b
commit 5aae51144d
3 changed files with 13 additions and 5 deletions

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 ) {
_.find( views, function( view, type ) {
var match = view.prototype.match( text );
if ( match ) {
$( node ).data( 'rendered', false ); $( node ).data( 'rendered', false );
editor.dom.setAttrib( node, 'data-wpview-text', encodeURIComponent( text ) ); editor.dom.setAttrib( node, 'data-wpview-text', encodeURIComponent( text ) );
wp.mce.views.createInstance( this.type, text, this.match( text ).options ).render(); wp.mce.views.createInstance( type, text, match.options ).render();
return true;
}
} );
}, },
/** /**

File diff suppressed because one or more lines are too long

View File

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