Merge pull request #277 from nightwing/cursor
when unfocused make cursor transparent instead of removing it
This commit is contained in:
commit
acd7e92351
2 changed files with 10 additions and 9 deletions
|
|
@ -117,6 +117,10 @@
|
|||
position: absolute;
|
||||
}
|
||||
|
||||
.ace_cursor.ace_hidden {
|
||||
opacity: 0.2;
|
||||
}
|
||||
|
||||
.ace_line {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,8 @@ var Cursor = function(parentEl) {
|
|||
parentEl.appendChild(this.element);
|
||||
|
||||
this.cursor = dom.createElement("div");
|
||||
this.cursor.className = "ace_cursor";
|
||||
this.cursor.className = "ace_cursor ace_hidden";
|
||||
this.element.appendChild(this.cursor);
|
||||
|
||||
this.isVisible = false;
|
||||
};
|
||||
|
|
@ -60,18 +61,14 @@ var Cursor = function(parentEl) {
|
|||
|
||||
this.hideCursor = function() {
|
||||
this.isVisible = false;
|
||||
if (this.cursor.parentNode) {
|
||||
this.cursor.parentNode.removeChild(this.cursor);
|
||||
}
|
||||
dom.addCssClass(this.cursor, "ace_hidden");
|
||||
clearInterval(this.blinkId);
|
||||
};
|
||||
|
||||
this.showCursor = function() {
|
||||
this.isVisible = true;
|
||||
this.element.appendChild(this.cursor);
|
||||
|
||||
var cursor = this.cursor;
|
||||
cursor.style.visibility = "visible";
|
||||
this.isVisible = true;
|
||||
dom.removeCssClass(this.cursor, "ace_hidden");
|
||||
this.cursor.style.visibility = "visible";
|
||||
this.restartTimer();
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue