clean up CSS and make it more IE6 friendly

This commit is contained in:
Fabian Jakobs 2010-04-19 15:42:10 +02:00
commit a9e2986121
5 changed files with 130 additions and 90 deletions

View file

@ -82,10 +82,8 @@ ace.Editor.prototype.setMode = function(mode) {
};
ace.Editor.prototype.resize = function()
{
this.renderer.scrollToY(this.renderer.getScrollTop());
this.renderer.draw();
ace.Editor.prototype.resize = function() {
this.renderer.onResize();
};
ace.Editor.prototype._highlightBrackets = function() {
@ -190,7 +188,10 @@ ace.Editor.prototype.onSelectionChange = function() {
ace.Editor.prototype.onMouseDown = function(e) {
this.textInput.focus();
var pos = this.renderer.screenToTextCoordinates(e.pageX, e.pageY);
var pageX = ace.getDocumentX(e);
var pageY = ace.getDocumentY(e);
var pos = this.renderer.screenToTextCoordinates(pageX, pageY);
this.moveCursorToPosition(pos);
this.selection.setSelectionAnchor(pos.row, pos.column);
this.renderer.scrollCursorIntoView();
@ -199,8 +200,8 @@ ace.Editor.prototype.onMouseDown = function(e) {
var mousePageX, mousePageY;
var onMouseSelection = function(e) {
mousePageX = e.pageX;
mousePageY = e.pageY;
mousePageX = ace.getDocumentX(e);
mousePageY = ace.getDocumentY(e);
};
var onMouseSelectionEnd = function() {

View file

@ -31,6 +31,8 @@ ace.VirtualRenderer = function(container) {
row : 0,
column : 0
};
this.onResize();
};
ace.VirtualRenderer.prototype.setDocument = function(doc) {
@ -56,6 +58,22 @@ ace.VirtualRenderer.prototype.getLastVisibleRow = function() {
return this.layerConfig.lastRow || 0;
};
ace.VirtualRenderer.prototype.onResize = function()
{
var height = ace.getInnerHeight(this.container);
this.gutter.style.height = height + "px";
this.scroller.style.height = height + "px";
var width = ace.getInnerWidth(this.container);
var gutterWidth = this.gutter.offsetWidth;
this.scroller.style.left = gutterWidth + "px";
this.scroller.style.width = Math.max(0, width - gutterWidth) + "px";
if (this.doc) {
this.scrollToY(this.getScrollTop());
}
};
ace.VirtualRenderer.prototype.updateLines = function(firstRow, lastRow) {
var layerConfig = this.layerConfig;