Index: trunk/extensions/VisualEditor/demos/ce/index.php |
— | — | @@ -157,6 +157,6 @@ |
158 | 158 | <!-- sandbox --> |
159 | 159 | <script src="main.js"></script> |
160 | 160 | |
161 | | - <div id="paste" contenteditable="true" style="height: 1px; width: 1px; position: absolute; left: -20000px;"></div> |
| 161 | + <div id="paste" contenteditable="true" style="height: 1px; width: 1px; display: none; opacity: 0; position: absolute;"></div> |
162 | 162 | </body> |
163 | 163 | </html> |
Index: trunk/extensions/VisualEditor/modules/ve/ce/ve.es.Surface.js |
— | — | @@ -55,19 +55,15 @@ |
56 | 56 | var insertionPoint = _this.getSelection().start; |
57 | 57 | console.log(_this.clipboard); |
58 | 58 | |
59 | | - var scrollTop = $(window).scrollTop(); |
| 59 | + $('#paste').html('').show().css('top', $(window).scrollTop()).css('left', $(window).scrollLeft()).focus(); |
60 | 60 | |
61 | | - $('#paste').html(''); |
62 | | - $('#paste').focus(); |
63 | | - |
64 | 61 | setTimeout(function() { |
65 | | - var key = $('#paste').text().replace(/( |\r\n|\n|\r|\t)/gm,""); |
| 62 | + var key = $('#paste').hide().text().replace(/( |\r\n|\n|\r|\t)/gm,""); |
66 | 63 | |
67 | 64 | if (_this.clipboard[key]) { |
68 | 65 | var tx = _this.documentView.model.prepareInsertion( insertionPoint, _this.clipboard[key]); |
69 | 66 | _this.documentView.model.commit(tx); |
70 | 67 | _this.showCursorAt(insertionPoint + _this.clipboard[key].length); |
71 | | - $(window).scrollTop(scrollTop); |
72 | 68 | } else { |
73 | 69 | alert('i can only handle copy/paste from hybrid surface. sorry. :('); |
74 | 70 | } |