Ticket #8409: ckeditor-8409.diff

File ckeditor-8409.diff, 1.1 KB (added by Chia-liang Kao, 11 years ago)
  • _source/plugins/clipboard/plugin.js

    Author: Chia-liang Kao <clkao@clkao.org>
    Date:   Thu Oct 18 13:13:31 2012 +0800
    
        Maintain current scroll position when pasting
    
    diff --git a/_source/plugins/clipboard/plugin.js b/_source/plugins/clipboard/plugin.js
    index 6c21f55..d4769ef 100644
    a b For licensing, see LICENSE.html or http://ckeditor.com/license 
    183183
    184184               var sel = this.getSelection(),
    185185                       range = new CKEDITOR.dom.range( doc );
     186               var scrollPosition = doc.getWindow().getScrollPosition();
    186187
    187188               // Create container to paste into
    188189               var pastebin = new CKEDITOR.dom.element( mode == 'text' ? 'textarea' : CKEDITOR.en
    For licensing, see LICENSE.html or http://ckeditor.com/license 
    229230
    230231                       editor.removeListener( 'selectionChange', cancel );
    231232
     233                       win.$.scrollTo(scrollPosition.x, scrollPosition.y);
     234
    232235                       // IE7: selection must go before removing paste bin. (#8691)
    233236                       if ( CKEDITOR.env.ie7Compat )
    234237                       {
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy