make container argument of VirtualRenderer optional
This commit is contained in:
parent
07792dab9a
commit
51a91e71af
1 changed files with 5 additions and 5 deletions
|
|
@ -69,16 +69,16 @@ dom.importCssString(editorCss, "ace_editor");
|
||||||
var VirtualRenderer = function(container, theme) {
|
var VirtualRenderer = function(container, theme) {
|
||||||
var _self = this;
|
var _self = this;
|
||||||
|
|
||||||
this.container = container;
|
this.container = container || dom.createElement("div");
|
||||||
|
|
||||||
// TODO: this breaks rendering in Cloud9 with multiple ace instances
|
// TODO: this breaks rendering in Cloud9 with multiple ace instances
|
||||||
// // Imports CSS once per DOM document ('ace_editor' serves as an identifier).
|
// // Imports CSS once per DOM document ('ace_editor' serves as an identifier).
|
||||||
// dom.importCssString(editorCss, "ace_editor", container.ownerDocument);
|
// dom.importCssString(editorCss, "ace_editor", container.ownerDocument);
|
||||||
|
|
||||||
// in IE <= 9 the native cursor always shines through
|
// in IE <= 9 the native cursor always shines through
|
||||||
this.$keepTextAreaAtCursor = !useragent.isIE;
|
this.$keepTextAreaAtCursor = !useragent.isIE;
|
||||||
|
|
||||||
dom.addCssClass(container, "ace_editor");
|
dom.addCssClass(this.container, "ace_editor");
|
||||||
|
|
||||||
this.setTheme(theme);
|
this.setTheme(theme);
|
||||||
|
|
||||||
|
|
@ -113,7 +113,7 @@ var VirtualRenderer = function(container, theme) {
|
||||||
|
|
||||||
this.$animatedScroll = false;
|
this.$animatedScroll = false;
|
||||||
|
|
||||||
this.scrollBar = new ScrollBar(container);
|
this.scrollBar = new ScrollBar(this.container);
|
||||||
this.scrollBar.addEventListener("scroll", function(e) {
|
this.scrollBar.addEventListener("scroll", function(e) {
|
||||||
if (!_self.$inScrollAnimation)
|
if (!_self.$inScrollAnimation)
|
||||||
_self.session.setScrollTop(e.data);
|
_self.session.setScrollTop(e.data);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue