mirror of
https://github.com/atom/atom.git
synced 2026-01-23 13:58:08 -05:00
Cursor is colored / blinks on on focused editor pane
This commit is contained in:
@@ -932,14 +932,16 @@ describe "Editor", ->
|
||||
expect(editor.hiddenInput).toMatchSelector ':focus'
|
||||
|
||||
describe "when the hidden input is focused / unfocused", ->
|
||||
it "assigns the isFocused flag on the editor", ->
|
||||
it "assigns the isFocused flag on the editor and also adds/removes the .focused css class", ->
|
||||
editor.attachToDom()
|
||||
editor.isFocused = false
|
||||
editor.hiddenInput.focus()
|
||||
expect(editor.isFocused).toBeTruthy()
|
||||
expect(editor).toHaveClass('focused')
|
||||
|
||||
editor.hiddenInput.focusout()
|
||||
expect(editor.isFocused).toBeFalsy()
|
||||
expect(editor).not.toHaveClass('focused')
|
||||
|
||||
describe "construction", ->
|
||||
it "assigns an empty buffer and correctly handles text input (regression coverage)", ->
|
||||
|
||||
@@ -108,8 +108,13 @@ class Editor extends View
|
||||
@hiddenInput.focus()
|
||||
false
|
||||
|
||||
@hiddenInput.on 'focus', => @isFocused = true
|
||||
@hiddenInput.on 'focusout', => @isFocused = false
|
||||
@hiddenInput.on 'focus', =>
|
||||
@isFocused = true
|
||||
@addClass 'focused'
|
||||
|
||||
@hiddenInput.on 'focusout', =>
|
||||
@isFocused = false
|
||||
@removeClass 'focused'
|
||||
|
||||
@on 'mousedown', '.fold-placeholder', (e) =>
|
||||
@destroyFold($(e.currentTarget).attr('foldId'))
|
||||
|
||||
@@ -67,11 +67,15 @@
|
||||
|
||||
.editor .cursor {
|
||||
position: absolute;
|
||||
border-left: 3px solid #9dff9d;
|
||||
border-left: 3px solid rgba(255, 255, 255, .4);
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.editor .cursor.idle {
|
||||
.editor.focused .cursor {
|
||||
border-color: #9dff9d;
|
||||
}
|
||||
|
||||
.editor.focused .cursor.idle {
|
||||
-webkit-animation: blink 0.6s;
|
||||
-webkit-animation-iteration-count: infinite;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user