do not emit focus event if editor is already focused
This commit is contained in:
parent
e38875cdfc
commit
51b15d3588
1 changed files with 6 additions and 0 deletions
|
|
@ -397,6 +397,9 @@ var Editor = function(renderer, session) {
|
|||
* Emitted once the editor comes into focus.
|
||||
**/
|
||||
this.onFocus = function() {
|
||||
if (this.$isFocused)
|
||||
return;
|
||||
this.$isFocused = true;
|
||||
this.renderer.showCursor();
|
||||
this.renderer.visualizeFocus();
|
||||
this._emit("focus");
|
||||
|
|
@ -408,6 +411,9 @@ var Editor = function(renderer, session) {
|
|||
* Emitted once the editor has been blurred.
|
||||
**/
|
||||
this.onBlur = function() {
|
||||
if (!this.$isFocused)
|
||||
return;
|
||||
this.$isFocused = false;
|
||||
this.renderer.hideCursor();
|
||||
this.renderer.visualizeBlur();
|
||||
this._emit("blur");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue