Ticket #4874: 4874.patch

File 4874.patch, 1.4 KB (added by Garry Yao, 14 years ago)
  • _source/plugins/clipboard/plugin.js

     
    303303                                        body.on( ( mode == 'text' && CKEDITOR.env.ie ) ? 'paste' : 'beforepaste',
    304304                                                function( evt )
    305305                                                {
     306                                                        if( depressBeforePasteEvent )
     307                                                                return;
     308
    306309                                                        getClipboardData.call( editor, evt, mode, function ( data )
    307310                                                        {
    308311                                                                // The very last guard to make sure the
     
    321324                                // If the "contextmenu" plugin is loaded, register the listeners.
    322325                                if ( editor.contextMenu )
    323326                                {
     327                                        var depressBeforePasteEvent;
    324328                                        function stateFromNamedCommand( command )
    325329                                        {
    326                                                 return editor.document.$.queryCommandEnabled( command ) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED;
     330                                                // IE Bug: queryCommandEnabled('paste') fires also 'beforepaste',
     331                                                // guard to distinguish from the ordinary sources( either
     332                                                // keyboard paste or execCommand ) (#4874).
     333                                                CKEDITOR.env.ie && command == 'Paste'&& ( depressBeforePasteEvent = 1 );
     334
     335                                                var retval = editor.document.$.queryCommandEnabled( command ) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED;
     336                                                depressBeforePasteEvent = 0;
     337                                                return retval;
    327338                                        }
    328339
    329340                                        editor.contextMenu.addListener( function()
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy