make container argument of VirtualRenderer optional

This commit is contained in:
nightwing 2012-12-18 22:16:22 +04:00
commit 51a91e71af

View file

@ -69,16 +69,16 @@ dom.importCssString(editorCss, "ace_editor");
var VirtualRenderer = function(container, theme) {
var _self = this;
this.container = container;
this.container = container || dom.createElement("div");
// TODO: this breaks rendering in Cloud9 with multiple ace instances
// // Imports CSS once per DOM document ('ace_editor' serves as an identifier).
// dom.importCssString(editorCss, "ace_editor", container.ownerDocument);
// // Imports CSS once per DOM document ('ace_editor' serves as an identifier).
// dom.importCssString(editorCss, "ace_editor", container.ownerDocument);
// in IE <= 9 the native cursor always shines through
this.$keepTextAreaAtCursor = !useragent.isIE;
dom.addCssClass(container, "ace_editor");
dom.addCssClass(this.container, "ace_editor");
this.setTheme(theme);
@ -113,7 +113,7 @@ var VirtualRenderer = function(container, theme) {
this.$animatedScroll = false;
this.scrollBar = new ScrollBar(container);
this.scrollBar = new ScrollBar(this.container);
this.scrollBar.addEventListener("scroll", function(e) {
if (!_self.$inScrollAnimation)
_self.session.setScrollTop(e.data);