From 7344f24d71f5dc3580bfeaccff46a9c8c8f47b10 Mon Sep 17 00:00:00 2001 From: Fabian Jakobs Date: Wed, 21 Apr 2010 17:11:24 +0200 Subject: [PATCH] add blur() method --- src/Editor.js | 6 +++++- src/TextInput.js | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Editor.js b/src/Editor.js index 77c81c4a..ddee8e20 100644 --- a/src/Editor.js +++ b/src/Editor.js @@ -10,7 +10,7 @@ ace.Editor = function(renderer, doc) { var self = this; ace.addListener(container, "mousedown", function(e) { self.focus(); - return ace.stopEvent(e); + return ace.preventDefault(e); }); var mouseTarget = renderer.getMouseEventTarget(); @@ -117,6 +117,10 @@ ace.Editor.prototype.focus = function() { this.textInput.focus(); }; +ace.Editor.prototype.blur = function() { + this.textInput.blur(); +}; + ace.Editor.prototype.onFocus = function() { this.renderer.showCursor(); this.renderer.visualizeFocus(); diff --git a/src/TextInput.js b/src/TextInput.js index 4a3c3c25..3d98121b 100644 --- a/src/TextInput.js +++ b/src/TextInput.js @@ -79,6 +79,6 @@ ace.TextInput = function(parentNode, host) { }; this.blur = function() { - this.blur(); + text.blur(); }; }; \ No newline at end of file