From fbff87f0b2d7604c6e823c00fe003498dcefa7ef Mon Sep 17 00:00:00 2001 From: Fabian Jakobs Date: Fri, 18 Feb 2011 15:46:15 +0100 Subject: [PATCH] only do dom operations in the update function --- lib/ace/layer/cursor.js | 14 ++++++++------ support/pilot | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/ace/layer/cursor.js b/lib/ace/layer/cursor.js index 636271c3..a796c84a 100644 --- a/lib/ace/layer/cursor.js +++ b/lib/ace/layer/cursor.js @@ -59,12 +59,7 @@ var Cursor = function(parentEl) { this.setCursor = function(position, overwrite) { this.position = position; - - if (overwrite) { - dom.addCssClass(this.cursor, "ace_overwrite"); - } else { - dom.removeCssClass(this.cursor, "ace_overwrite"); - } + this.overwrite = overwrite; }; this.hideCursor = function() { @@ -134,6 +129,13 @@ var Cursor = function(parentEl) { if (this.isVisible) { this.element.appendChild(this.cursor); } + + if (overwrite) { + dom.addCssClass(this.cursor, "ace_overwrite"); + } else { + dom.removeCssClass(this.cursor, "ace_overwrite"); + } + this.restartTimer(); }; diff --git a/support/pilot b/support/pilot index 6e1fbe1d..cbfac498 160000 --- a/support/pilot +++ b/support/pilot @@ -1 +1 @@ -Subproject commit 6e1fbe1dfdff64020f15cd9e23ea72b7803cf406 +Subproject commit cbfac498d30d43fdb7687d198c5b752736222c2f