JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.4b
[ckeditor.git] / _source / plugins / clipboard / plugin.js
index f3cb0c0..9dc230e 100644 (file)
@@ -386,14 +386,13 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                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