Ticket #7304: 7304_2.patch

File 7304_2.patch, 1.8 KB (added by Garry Yao, 13 years ago)
  • _source/plugins/clipboard/plugin.js

     
    327327                                                else if ( data[ 'text' ] )
    328328                                                        editor.insertText( data[ 'text' ] );
    329329
     330                                                setTimeout( function () { editor.fire( 'afterPaste' ) }, 0 );
     331
    330332                                        }, null, null, 1000 );
    331333
    332334                                editor.on( 'pasteDialog', function( evt )
  • _source/plugins/pastefromword/plugin.js

     
    1212                        // Flag indicate this command is actually been asked instead of a generic
    1313                        // pasting.
    1414                        var forceFromWord = 0;
    15                         var resetFromWord = function()
     15                        var resetFromWord = function( evt )
    1616                                {
    17                                         setTimeout( function() { forceFromWord = 0; }, 0 );
     17                                        evt && evt.removeListener();
     18                                        forceFromWord && setTimeout( function() { forceFromWord = 0; }, 0 );
    1819                                };
    1920
    2021                        // Features bring by this command beside the normal process:
     
    2930                                        forceFromWord = 1;
    3031                                        if ( editor.execCommand( 'paste' ) === false )
    3132                                        {
    32                                                 editor.on( 'dialogHide', function ( evt )
    33                                                         {
    34                                                                 evt.removeListener();
    35                                                                 resetFromWord();
    36                                                         });
     33                                                editor.on( 'dialogShow', function ( evt )
     34                                                {
     35                                                        evt.removeListener();
     36                                                        evt.data.on( 'cancel', resetFromWord );
     37                                                });
     38
     39                                                editor.on( 'dialogHide', function( evt )
     40                                                {
     41                                                        evt.data.removeListener( 'cancel', resetFromWord );
     42                                                } );
    3743                                        }
    38                                         else
    39                                                 resetFromWord();
     44
     45                                        editor.on( 'afterPaste', resetFromWord );
    4046                                }
    4147                        });
    4248
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy