hide cursor on blur
This commit is contained in:
parent
fc57e3e64b
commit
76aef02db4
1 changed files with 18 additions and 0 deletions
18
editor.html
18
editor.html
|
|
@ -295,10 +295,12 @@ Editor.prototype =
|
|||
},
|
||||
|
||||
onFocus : function() {
|
||||
this.renderer.showCursor();
|
||||
this.renderer.visualizeFocus();
|
||||
},
|
||||
|
||||
onBlur : function() {
|
||||
this.renderer.hideCursor();
|
||||
this.renderer.visualizeBlur();
|
||||
},
|
||||
|
||||
|
|
@ -554,6 +556,22 @@ DumbRenderer.prototype =
|
|||
this.cursor.style.left = left + "px";
|
||||
this.cursor.style.top = top + "px";
|
||||
|
||||
if (this.cursorVisible) {
|
||||
this.canvas.appendChild(this.cursor);
|
||||
}
|
||||
},
|
||||
|
||||
hideCursor : function()
|
||||
{
|
||||
this.cursorVisible = true;
|
||||
if (this.cursor.parentNode) {
|
||||
this.cursor.parentNode.removeChild(this.cursor);
|
||||
}
|
||||
},
|
||||
|
||||
showCursor : function()
|
||||
{
|
||||
this.cursorVisible = true;
|
||||
this.canvas.appendChild(this.cursor);
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue