From e216a6f8ab631749655447a5434328caad7cfbbb Mon Sep 17 00:00:00 2001 From: Christian Williams Date: Wed, 30 May 2012 13:06:19 -0700 Subject: [PATCH] Fixed scroll jumping when pasting Change-Id: I9607dee6d1b0ca1820a9da5f48966310214e5edf --- modules/ve2/ce/ve.ce.Surface.js | 7 +------ modules/ve2/ve.Surface.js | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/modules/ve2/ce/ve.ce.Surface.js b/modules/ve2/ce/ve.ce.Surface.js index cec079dbe2..d9fcd3927b 100644 --- a/modules/ve2/ce/ve.ce.Surface.js +++ b/modules/ve2/ce/ve.ce.Surface.js @@ -185,12 +185,7 @@ ve.ce.Surface.prototype.onPaste = function( e ) { var _this = this, insertionPoint = _this.getSelectionRange().start; - $('#paste') - .html('') - .show() - .css( 'top', $(window).scrollTop() ) - .css( 'left', $(window).scrollLeft() ) - .focus(); + $('#paste').html('').show().focus(); setTimeout( function() { var pasteString = $('#paste').hide().text(), diff --git a/modules/ve2/ve.Surface.js b/modules/ve2/ve.Surface.js index 6e33a86cf0..81f83035e6 100644 --- a/modules/ve2/ve.Surface.js +++ b/modules/ve2/ve.Surface.js @@ -87,7 +87,7 @@ ve.Surface.prototype.setupBaseElements = function() { 'id': 'paste', //TODO: make 'paste' in surface stateful and remove this attrib 'class': 'paste', 'contenteditable': 'true', - 'style': 'height:1px;width:1px;display:none;opacity:0;position:absolute;' + 'style': 'height:1px;width:1px;overflow:hidden;position:fixed;display:none;opacity:0;top:0;left:0;' }) ); // Attach the base the the parent