Make WordPress Core

Changeset 34032


Ignore:
Timestamp:
09/11/2015 01:46:17 AM (11 years ago)
Author:
azaozz
Message:

TinyMCE: ensure the wordpress plugin is loaded before calling _createToolbar().

Props hauvong, azaozz.
Fixes #33393 for 4.3.

Location:
branches/4.3/src/wp-includes/js/tinymce/plugins
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/4.3/src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js

    r33141 r34032  
    6262
    6363        editor.once( 'preinit', function() {
    64                 toolbar = editor.wp._createToolbar( [
    65                         'wp_img_alignleft',
    66                         'wp_img_aligncenter',
    67                         'wp_img_alignright',
    68                         'wp_img_alignnone',
    69                         'wp_img_edit',
    70                         'wp_img_remove'
    71                 ] );
     64                if ( editor.wp && editor.wp._createToolbar ) {
     65                        toolbar = editor.wp._createToolbar( [
     66                                'wp_img_alignleft',
     67                                'wp_img_aligncenter',
     68                                'wp_img_alignright',
     69                                'wp_img_alignnone',
     70                                'wp_img_edit',
     71                                'wp_img_remove'
     72                        ] );
     73                }
    7274        } );
    7375
    … …  
    8991                                        editor.nodeChanged();
    9092                                }, 200 );
    91                         } else {
     93                        } else if ( toolbar ) {
    9294                                toolbar.hide();
    9395                        }
  • branches/4.3/src/wp-includes/js/tinymce/plugins/wplink/plugin.js

    r33584 r34032  
    137137
    138138                editor.on( 'preinit', function() {
    139                         toolbar = editor.wp._createToolbar( [
    140                                 'wp_link_preview',
    141                                 'wp_link_edit',
    142                                 'wp_link_remove'
    143                         ], true );
     139                        if ( editor.wp && editor.wp._createToolbar ) {
     140                                toolbar = editor.wp._createToolbar( [
     141                                        'wp_link_preview',
     142                                        'wp_link_edit',
     143                                        'wp_link_remove'
     144                                ], true );
     145                        }
    144146                } );
    145147        } );
  • branches/4.3/src/wp-includes/js/tinymce/plugins/wpview/plugin.js

    r33484 r34032  
    714714
    715715        editor.once( 'preinit', function() {
    716                 toolbar = editor.wp._createToolbar( [
    717                         'wp_view_edit',
    718                         'wp_view_remove'
    719                 ] );
     716                if ( editor.wp && editor.wp._createToolbar ) {
     717                        toolbar = editor.wp._createToolbar( [
     718                                'wp_view_edit',
     719                                'wp_view_remove'
     720                        ] );
     721                }
    720722        } );
    721723
Note: See TracChangeset for help on using the changeset viewer.