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

@ -9946,7 +9946,7 @@ var VirtualRenderer = function(container, theme) {
}; };
this.getTextAreaContainer = function() { this.getTextAreaContainer = function() {
return this.scroller; return this.container;
}; };
this.moveTextAreaToCursor = function(textarea) { this.moveTextAreaToCursor = function(textarea) {
@ -9954,8 +9954,11 @@ var VirtualRenderer = function(container, theme) {
if (!pos) if (!pos)
return; return;
textarea.style.left = (pos.left + this.$padding) + "px"; var bounds = this.content.getBoundingClientRect();
textarea.style.top = pos.top + "px"; 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() { this.getFirstVisibleRow = function() {
@ -11417,7 +11420,7 @@ define("text!ace/css/editor.css", ".ace_editor {" +
"}" + "}" +
"" + "" +
".ace_editor textarea {" + ".ace_editor textarea {" +
" position: absolute;" + " position: fixed;" +
" z-index: -1;" + " z-index: -1;" +
" opacity: 0;" + " opacity: 0;" +
" width: 10px;" + " width: 10px;" +

File diff suppressed because one or more lines are too long

View file

@ -45,7 +45,7 @@ require({
}); });
var deps = [ "pilot/fixoldbrowsers", "pilot/plugin_manager", "pilot/settings", var deps = [ "pilot/fixoldbrowsers", "pilot/plugin_manager", "pilot/settings",
"pilot/environment", "demo/startup" ]; "pilot/environment", "demo/demo" ];
var plugins = [ "pilot/index", "cockpit/index", "ace/defaults" ]; var plugins = [ "pilot/index", "cockpit/index", "ace/defaults" ];
require(deps, function() { require(deps, function() {

View file

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

View file

@ -297,7 +297,7 @@ var VirtualRenderer = function(container, theme) {
}; };
this.getTextAreaContainer = function() { this.getTextAreaContainer = function() {
return this.scroller; return this.container;
}; };
this.moveTextAreaToCursor = function(textarea) { this.moveTextAreaToCursor = function(textarea) {
@ -305,8 +305,11 @@ var VirtualRenderer = function(container, theme) {
if (!pos) if (!pos)
return; return;
textarea.style.left = (pos.left + this.$padding) + "px"; var bounds = this.content.getBoundingClientRect();
textarea.style.top = pos.top + "px"; 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() { this.getFirstVisibleRow = function() {

View file

@ -1,7 +1,7 @@
{ {
"name": "ace", "name": "ace",
"description": "Ajax.org Code Editor is a full featured source code highlighting editor that powers the Cloud9 IDE", "description": "Ajax.org Code Editor is a full featured source code highlighting editor that powers the Cloud9 IDE",
"version": "0.1.0", "version": "0.1.1",
"homepage" : "http://github.com/ajaxorg/ace", "homepage" : "http://github.com/ajaxorg/ace",
"engines": {"node": ">= 0.2.0"}, "engines": {"node": ">= 0.2.0"},
"author": "Fabian Jakobs <fabian@ajax.org>", "author": "Fabian Jakobs <fabian@ajax.org>",