Make WordPress Core

Ticket #28921: 28921.diff

File 28921.diff, 1.1 KB (added by imath, 11 years ago)
  • src/wp-includes/js/tinymce/plugins/wplink/plugin.js

     
    11/* global tinymce */
    22tinymce.PluginManager.add( 'wplink', function( editor ) {
    33        var linkButton;
    4        
     4
    55        // Register a command so that it can be invoked by using tinyMCE.activeEditor.execCommand( 'WP_Link' );
    66        editor.addCommand( 'WP_Link', function() {
    77                if ( ( ! linkButton || ! linkButton.disabled() ) && typeof window.wpLink !== 'undefined' ) {
     
    1616
    1717        function setState( button, node ) {
    1818                var parent = editor.dom.getParent( node, 'a' ),
    19                         getView = editor.plugins.wpview ? editor.plugins.wpview.getView : function() { return false; };
     19                        getView = typeof editor.plugins.wpview.getView != 'undefined' ? editor.plugins.wpview.getView : function() { return false; };
    2020
    2121                button.disabled( ( editor.selection.isCollapsed() && ! parent ) || ( parent && ! parent.href ) || getView( node ) );
    2222                button.active( parent && parent.href );