X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=_source%2Fplugins%2Fclipboard%2Fplugin.js;h=23c58bf9437ea256790919b521a4c538fec7f3dd;hb=e7789c1ad838194d45eeee6ac2eb6e55f5cf35a1;hp=8dbacc6cebd2ec1c4eebb65dbb27b1e23c064018;hpb=059b4c2fef02528bf1af189f7996e80652faddfb;p=ckeditor.git diff --git a/_source/plugins/clipboard/plugin.js b/_source/plugins/clipboard/plugin.js index 8dbacc6..23c58bf 100644 --- a/_source/plugins/clipboard/plugin.js +++ b/_source/plugins/clipboard/plugin.js @@ -28,7 +28,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license // the command to execute. body.on( command, onExec ); - doc.$.execCommand( command ); + // IE6/7: document.execCommand has problem to paste into positioned element. + ( CKEDITOR.env.version > 7 ? doc.$ : doc.$.selection.createRange() ) [ 'execCommand' ]( command ); body.removeListener( command, onExec ); @@ -188,22 +189,18 @@ For licensing, see LICENSE.html or http://ckeditor.com/license doc.getBody().append( pastebin ); // It's definitely a better user experience if we make the paste-bin pretty unnoticed - // by pulling it off the screen, while this hack will make the paste-bin a control type element - // and that become a selection plain later. - if ( !CKEDITOR.env.ie && mode != 'html' ) - { - pastebin.setStyles( - { - position : 'absolute', - left : '-1000px', - // Position the bin exactly at the position of the selected element - // to avoid any subsequent document scroll. - top : sel.getStartElement().getDocumentPosition().y + 'px', - width : '1px', - height : '1px', - overflow : 'hidden' - }); - } + // by pulling it off the screen. + pastebin.setStyles( + { + position : 'absolute', + left : '-1000px', + // Position the bin exactly at the position of the selected element + // to avoid any subsequent document scroll. + top : sel.getStartElement().getDocumentPosition().y + 'px', + width : '1px', + height : '1px', + overflow : 'hidden' + }); var bms = sel.createBookmarks();