Ticket #3749: 3749.patch

File 3749.patch, 1.0 KB (added by Martin Kou, 15 years ago)
  • _source/plugins/clipboard/plugin.js

     
    187187                                // If the "contextmenu" plugin is loaded, register the listeners.
    188188                                if ( editor.contextMenu )
    189189                                {
     190                                        function stateFromNamedCommand( command )
     191                                        {
     192                                                return editor.document.$.queryCommandEnabled( command ) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED;
     193                                        }
     194
    190195                                        editor.contextMenu.addListener( function()
    191196                                                {
    192197                                                        return {
    193                                                                 cut : CKEDITOR.TRISTATE_DISABLED ,
    194                                                                 copy : CKEDITOR.TRISTATE_DISABLED,
    195                                                                 paste : CKEDITOR.TRISTATE_DISABLED };
     198                                                                cut : stateFromNamedCommand( 'Cut' ),
     199
     200                                                                // Browser bug: 'Cut' has the correct states for both Copy and Cut.
     201                                                                copy : stateFromNamedCommand( 'Cut' ),
     202                                                                paste : stateFromNamedCommand( 'Paste' )
     203                                                        };
    196204                                                });
    197205                                }
    198206                        }
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy