JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.2.1
[ckeditor.git] / _source / plugins / clipboard / plugin.js
index 8dbacc6..23c58bf 100644 (file)
@@ -28,7 +28,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                // the command to execute.\r
                body.on( command, onExec );\r
 \r
-               doc.$.execCommand( command );\r
+               // IE6/7: document.execCommand has problem to paste into positioned element.\r
+               ( CKEDITOR.env.version > 7 ? doc.$ : doc.$.selection.createRange() ) [ 'execCommand' ]( command );\r
 \r
                body.removeListener( command, onExec );\r
 \r
@@ -188,22 +189,18 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                doc.getBody().append( pastebin );\r
 \r
                // It's definitely a better user experience if we make the paste-bin pretty unnoticed\r
-               // by pulling it off the screen, while this hack will make the paste-bin a control type element\r
-               // and that become a selection plain later.\r
-               if ( !CKEDITOR.env.ie && mode != 'html' )\r
-               {\r
-                       pastebin.setStyles(\r
-                               {\r
-                                       position : 'absolute',\r
-                                       left : '-1000px',\r
-                                       // Position the bin exactly at the position of the selected element\r
-                                       // to avoid any subsequent document scroll.\r
-                                       top : sel.getStartElement().getDocumentPosition().y + 'px',\r
-                                       width : '1px',\r
-                                       height : '1px',\r
-                                       overflow : 'hidden'\r
-                               });\r
-               }\r
+               // by pulling it off the screen.\r
+               pastebin.setStyles(\r
+                       {\r
+                               position : 'absolute',\r
+                               left : '-1000px',\r
+                               // Position the bin exactly at the position of the selected element\r
+                               // to avoid any subsequent document scroll.\r
+                               top : sel.getStartElement().getDocumentPosition().y + 'px',\r
+                               width : '1px',\r
+                               height : '1px',\r
+                               overflow : 'hidden'\r
+                       });\r
 \r
                var bms = sel.createBookmarks();\r
 \r