Ticket #28921: 28921.diff
File 28921.diff, 1.1 KB (added by , 11 years ago) |
---|
-
src/wp-includes/js/tinymce/plugins/wplink/plugin.js
1 1 /* global tinymce */ 2 2 tinymce.PluginManager.add( 'wplink', function( editor ) { 3 3 var linkButton; 4 4 5 5 // Register a command so that it can be invoked by using tinyMCE.activeEditor.execCommand( 'WP_Link' ); 6 6 editor.addCommand( 'WP_Link', function() { 7 7 if ( ( ! linkButton || ! linkButton.disabled() ) && typeof window.wpLink !== 'undefined' ) { … … 16 16 17 17 function setState( button, node ) { 18 18 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; }; 20 20 21 21 button.disabled( ( editor.selection.isCollapsed() && ! parent ) || ( parent && ! parent.href ) || getView( node ) ); 22 22 button.active( parent && parent.href );