Make WordPress Core

Changeset 31586


Ignore:
Timestamp:
02/27/2015 10:28:58 PM (9 years ago)
Author:
azaozz
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/mce-view.js

    r31559 r31586  
    649649         */
    650650        update: function( text, editor, node ) {
    651             $( node ).data( 'rendered', false );
    652             editor.dom.setAttrib( node, 'data-wpview-text', encodeURIComponent( text ) );
    653             wp.mce.views.createInstance( this.type, text, this.match( text ).options ).render();
     651            _.find( views, function( view, type ) {
     652                var match = view.prototype.match( text );
     653
     654                if ( match ) {
     655                    $( node ).data( 'rendered', false );
     656                    editor.dom.setAttrib( node, 'data-wpview-text', encodeURIComponent( text ) );
     657                    wp.mce.views.createInstance( type, text, match.options ).render();
     658
     659                    return true;
     660                }
     661            } );
    654662        },
    655663
Note: See TracChangeset for help on using the changeset viewer.