moving the textarea into view broke rendering

This commit is contained in:
Fabian Jakobs 2011-02-01 09:09:40 +01:00
commit d2f0bebf42
6 changed files with 20 additions and 14 deletions

View file

@ -74,7 +74,7 @@
}
.ace_editor textarea {
position: absolute;
position: fixed;
z-index: -1;
opacity: 0;
width: 10px;

View file

@ -297,16 +297,19 @@ var VirtualRenderer = function(container, theme) {
};
this.getTextAreaContainer = function() {
return this.scroller;
return this.container;
};
this.moveTextAreaToCursor = function(textarea) {
this.moveTextAreaToCursor = function(textarea) {
var pos = this.$cursorLayer.getPixelPosition();
if (!pos)
return;
textarea.style.left = (pos.left + this.$padding) + "px";
textarea.style.top = pos.top + "px";
var bounds = this.content.getBoundingClientRect();
var offset = (this.layerConfig && this.layerConfig.offset) || 0;
textarea.style.left = (bounds.left + pos.left + this.$padding) + "px";
textarea.style.top = (bounds.top + pos.top - this.scrollTop + offset) + "px";
};
this.getFirstVisibleRow = function() {