do not call dom functions if possible

This commit is contained in:
nightwing 2011-05-22 13:30:35 +05:00 committed by Fabian Jakobs
commit 6464a3852b

View file

@ -120,14 +120,13 @@ var Cursor = function(parentEl) {
this.cursor.style.width = config.characterWidth + "px";
this.cursor.style.height = config.lineHeight + "px";
if (this.isVisible) {
this.element.appendChild(this.cursor);
}
if (this.session.getOverwrite()) {
dom.addCssClass(this.cursor, "ace_overwrite");
} else {
dom.removeCssClass(this.cursor, "ace_overwrite");
var overwrite = this.session.getOverwrite()
if (overwrite != this.overwrite) {
this.overwrite = overwrite;
if (overwrite)
dom.addCssClass(this.cursor, "ace_overwrite");
else
dom.removeCssClass(this.cursor, "ace_overwrite");
}
this.restartTimer();