allow layers to be sized automatically

This commit is contained in:
nightwing 2011-01-06 17:31:55 +04:00 committed by Fabian Jakobs
commit 21d2d83af1
2 changed files with 3 additions and 9 deletions

View file

@ -43,6 +43,7 @@
overflow: hidden;
white-space: nowrap;
height: 100%;
width: 100%;
}
.ace_text-layer {

View file

@ -67,7 +67,8 @@ var VirtualRenderer = function(container, theme) {
this.container.appendChild(this.scroller);
this.content = document.createElement("div");
this.content.style.position = "absolute";
this.content.style.cssText = "position:absolute;box-sizing:border-box;" +
"-moz-box-sizing:border-box;-webkit-box-sizing:border-box";
this.scroller.appendChild(this.content);
this.$gutterLayer = new GutterLayer(this.$gutter);
@ -409,14 +410,6 @@ var VirtualRenderer = function(container, theme) {
height : this.$size.scrollerHeight
};
for ( var i = 0; i < this.layers.length; i++) {
var layer = this.layers[i];
if (widthChanged) {
var style = layer.element.style;
style.width = longestLine + "px";
}
};
this.$gutterLayer.element.style.marginTop = (-offset) + "px";
this.content.style.marginTop = (-offset) + "px";
this.content.style.width = longestLine + "px";