From 022b5fb88ca025c7be0065c105e199eaa964ac06 Mon Sep 17 00:00:00 2001 From: Justin Palmer Date: Mon, 4 Feb 2013 16:42:46 -0800 Subject: [PATCH] use is-focused for the editor because it needs it's own state independent of the window state --- src/app/editor.coffee | 4 ++-- static/editor.css | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/app/editor.coffee b/src/app/editor.coffee index 83ebbbd6c..2e994dc44 100644 --- a/src/app/editor.coffee +++ b/src/app/editor.coffee @@ -351,12 +351,12 @@ class Editor extends View @hiddenInput.on 'focus', => @rootView()?.editorFocused(this) @isFocused = true - @removeClass 'is-blurred' + @addClass 'is-focused' @hiddenInput.on 'focusout', => @isFocused = false @autosave() if config.get "editor.autosave" - @addClass 'is-blurred' + @removeClass 'is-focused' @underlayer.on 'click', (e) => return unless e.target is @underlayer[0] diff --git a/static/editor.css b/static/editor.css index 86b463bda..83ee6efb2 100644 --- a/static/editor.css +++ b/static/editor.css @@ -77,7 +77,7 @@ } .editor.is-blurred .line.cursor-line { - opacity: 0; + background: rgba(0, 0, 0, 0); } .editor .invisible { @@ -142,11 +142,15 @@ border-left: 1px solid; } -.is-blurred .cursor, -.editor .cursor.blink-off { +.editor .cursor, +.editor.is-focused .cursor.blink-off { visibility: hidden; } +.editor.is-focused .cursor { + visibility: visible; +} + .editor .hidden-input { position: absolute; z-index: -1; @@ -160,7 +164,3 @@ pointer-events: none; z-index: -1; } - -.editor.is-blurred .selection .region { - opacity: 0; -}