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 );
}