return retval;\r
}\r
\r
- editor.contextMenu.addListener( function()\r
+ editor.contextMenu.addListener( function( element, selection )\r
{\r
+ var readOnly = selection.getCommonAncestor().isReadOnly();\r
return {\r
- cut : stateFromNamedCommand( 'Cut' ),\r
-\r
- // Browser bug: 'Cut' has the correct states for both Copy and Cut.\r
- copy : stateFromNamedCommand( 'Cut' ),\r
- paste : CKEDITOR.env.webkit ? CKEDITOR.TRISTATE_OFF : stateFromNamedCommand( 'Paste' )\r
+ cut : !readOnly && stateFromNamedCommand( 'Cut' ),\r
+ copy : stateFromNamedCommand( 'Copy' ),\r
+ paste : !readOnly && ( CKEDITOR.env.webkit ? CKEDITOR.TRISTATE_OFF : stateFromNamedCommand( 'Paste' ) )\r
};\r
});\r
}\r