Merge branch 'master' of github.com:ajaxorg/ace

This commit is contained in:
Sergi Mansilla 2011-02-27 12:47:56 +01:00
commit 4315fd36cf
2 changed files with 16 additions and 4 deletions

View file

@ -113,13 +113,17 @@ var Text = function(parentEl) {
// Note: characterWidth can be a float! // Note: characterWidth can be a float!
measureNode.innerHTML = lang.stringRepeat("Xy", n); measureNode.innerHTML = lang.stringRepeat("Xy", n);
if (document.body) {
document.body.appendChild(measureNode);
} else {
var container = this.element.parentNode; var container = this.element.parentNode;
while (!dom.hasCssClass(container, "ace_editor")) while (!dom.hasCssClass(container, "ace_editor"))
container = container.parentNode; container = container.parentNode;
container.appendChild(measureNode); container.appendChild(measureNode);
} }
}
var style = this.$measureNode.style; var style = this.$measureNode.style;
for (var prop in this.$fontStyles) { for (var prop in this.$fontStyles) {
var value = dom.computedStyle(this.element, prop); var value = dom.computedStyle(this.element, prop);

View file

@ -278,6 +278,10 @@ var VirtualRenderer = function(container, theme) {
return this.$printMarginColumn; return this.$printMarginColumn;
}; };
this.getShowGutter = function(){
return this.showGutter;
}
this.setShowGutter = function(show){ this.setShowGutter = function(show){
if(this.showGutter === show) if(this.showGutter === show)
return; return;
@ -365,6 +369,10 @@ var VirtualRenderer = function(container, theme) {
this.$updatePrintMargin(); this.$updatePrintMargin();
}; };
this.getHScrollBarAlwaysVisible = function() {
return this.$horizScrollAlwaysVisible;
}
this.setHScrollBarAlwaysVisible = function(alwaysVisible) { this.setHScrollBarAlwaysVisible = function(alwaysVisible) {
if (this.$horizScrollAlwaysVisible != alwaysVisible) { if (this.$horizScrollAlwaysVisible != alwaysVisible) {
this.$horizScrollAlwaysVisible = alwaysVisible; this.$horizScrollAlwaysVisible = alwaysVisible;