Ticket #7366: 7366_4.patch

File 7366_4.patch, 1.5 KB (added by Garry Yao, 12 years ago)
  • _source/plugins/clipboard/plugin.js

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    385385                                                        if ( depressBeforeEvent )
    386386                                                                return;
    387387
     388                                                        // Dismiss the "beforepaste" event fired in IE when
     389                                                        // opening browser toolbar/context menu.
     390                                                        var domEvent = evt.data && evt.data.$;
     391                                                        if ( CKEDITOR.env.ie && domEvent && !domEvent.ctrlKey )
     392                                                                return;
     393
    388394                                                        // Fire 'beforePaste' event so clipboard flavor get customized
    389395                                                        // by other plugins.
    390396                                                        var eventData =  { mode : 'html' };
     
    403409                                                        } );
    404410                                                });
    405411
    406                                         // Dismiss the (wrong) 'beforepaste' event fired on context menu open. (#7953)
    407                                         body.on( 'contextmenu', function()
     412                                        // Handle the late coming "paste" event from browser toolbar/context menu.
     413                                        body.on( 'paste', function( evt )
    408414                                        {
    409                                                 depressBeforeEvent = 1;
    410                                                 setTimeout( function() { depressBeforeEvent = 0; }, 10 );
    411                                         });
     415                                                if ( !editor.document.getById( 'cke_pastebin' ) )
     416                                                {
     417                                                        // Prevent native paste.
     418                                                        evt.data.preventDefault();
     419
     420                                                        // Resort to the paste command.
     421                                                        pasteCmd.exec( editor );
     422                                                }
     423                                        } );
     424
    412425
    413426                                        body.on( 'beforecut', function() { !depressBeforeEvent && fixCut( editor ); } );
    414427
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy