add blur() method

This commit is contained in:
Fabian Jakobs 2010-04-21 17:11:24 +02:00
commit 7344f24d71
2 changed files with 6 additions and 2 deletions

View file

@ -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();

View file

@ -79,6 +79,6 @@ ace.TextInput = function(parentNode, host) {
};
this.blur = function() {
this.blur();
text.blur();
};
};