]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/js/tinymce/plugins/wplink/plugin.js
WordPress 4.0
[autoinstalls/wordpress.git] / wp-includes / js / tinymce / plugins / wplink / plugin.js
index d992360b86552f462ec4a21fc93b0961f538d313..8c055857fb6187b5231b2fc3a84ef6008ff81cd8 100644 (file)
@@ -15,9 +15,10 @@ tinymce.PluginManager.add( 'wplink', function( editor ) {
        editor.addShortcut( 'ctrl+k', '', 'WP_Link' );
 
        function setState( button, node ) {
-               var parent = editor.dom.getParent( node, 'a' );
+               var parent = editor.dom.getParent( node, 'a' ),
+                       getView = editor.plugins.wpview ? editor.plugins.wpview.getView : function() { return false; };
 
-               button.disabled( ( editor.selection.isCollapsed() && ! parent ) || ( parent && ! parent.href ) );
+               button.disabled( ( editor.selection.isCollapsed() && ! parent ) || ( parent && ! parent.href ) || getView( node ) );
                button.active( parent && parent.href );
        }