X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fplugins%2Fclipboard%2Fplugin.js;h=9dc230ebd1e0ff65f43078532fe353dd4b7334a9;hp=f3cb0c0c172a567d0ddc69b99e27496eab632105;hb=e371ddf8abcb89013e20e6d0dd746adec344d0e5;hpb=055b6b0792ce7dc53d47af606b367c04b927c2ab diff --git a/_source/plugins/clipboard/plugin.js b/_source/plugins/clipboard/plugin.js index f3cb0c0..9dc230e 100644 --- a/_source/plugins/clipboard/plugin.js +++ b/_source/plugins/clipboard/plugin.js @@ -386,14 +386,13 @@ For licensing, see LICENSE.html or http://ckeditor.com/license return retval; } - editor.contextMenu.addListener( function() + editor.contextMenu.addListener( function( element, selection ) { + var readOnly = selection.getCommonAncestor().isReadOnly(); return { - cut : stateFromNamedCommand( 'Cut' ), - - // Browser bug: 'Cut' has the correct states for both Copy and Cut. - copy : stateFromNamedCommand( 'Cut' ), - paste : CKEDITOR.env.webkit ? CKEDITOR.TRISTATE_OFF : stateFromNamedCommand( 'Paste' ) + cut : !readOnly && stateFromNamedCommand( 'Cut' ), + copy : stateFromNamedCommand( 'Copy' ), + paste : !readOnly && ( CKEDITOR.env.webkit ? CKEDITOR.TRISTATE_OFF : stateFromNamedCommand( 'Paste' ) ) }; }); }