From 4ab41d02cce23966bb847cc5cd5b678cf48a431a Mon Sep 17 00:00:00 2001 From: nightwing Date: Fri, 26 Oct 2012 20:55:36 +0400 Subject: [PATCH] cursors should start in hidden state --- lib/ace/layer/cursor.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/lib/ace/layer/cursor.js b/lib/ace/layer/cursor.js index f4c1ae97..a15e7581 100644 --- a/lib/ace/layer/cursor.js +++ b/lib/ace/layer/cursor.js @@ -45,6 +45,7 @@ var Cursor = function(parentEl) { this.cursors = []; this.cursor = this.addCursor(); + dom.addCssClass(this.element, "ace_hidden-cursors"); }; (function() { @@ -146,12 +147,8 @@ var Cursor = function(parentEl) { }; this.getPixelPosition = function(position, onScreen) { - if (!this.config || !this.session) { - return { - left : 0, - top : 0 - }; - } + if (!this.config || !this.session) + return {left : 0, top : 0}; if (!position) position = this.session.selection.getCursor(); @@ -161,10 +158,7 @@ var Cursor = function(parentEl) { var cursorTop = (pos.row - (onScreen ? this.config.firstRowScreen : 0)) * this.config.lineHeight; - return { - left : cursorLeft, - top : cursorTop - }; + return {left : cursorLeft, top : cursorTop}; }; this.update = function(config) {