From d0a213b2b1c07ef351d00c424a3865adaafffcd6 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 11 Dec 2012 16:56:16 -0800 Subject: [PATCH] Move octicon values to content property --- spec/app/status-bar-spec.coffee | 12 ++++++------ src/app/status-bar.coffee | 7 ++++--- static/status-bar.css | 8 ++++++++ 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/spec/app/status-bar-spec.coffee b/spec/app/status-bar-spec.coffee index c3a4bc657..3f9f47d11 100644 --- a/spec/app/status-bar-spec.coffee +++ b/spec/app/status-bar-spec.coffee @@ -141,7 +141,7 @@ describe "StatusBar", -> it "displays the modified icon for a changed file", -> fs.write(path, "i've changed for the worse") rootView.open(path) - expect(statusBar.gitStatusIcon).toHaveText('\uf26d') + expect(statusBar.gitStatusIcon).toHaveClass('modified-status-icon') it "doesn't display the modified icon for an unchanged file", -> rootView.open(path) @@ -149,20 +149,20 @@ describe "StatusBar", -> it "displays the new icon for a new file", -> rootView.open(newPath) - expect(statusBar.gitStatusIcon).toHaveText('\uf26b') + expect(statusBar.gitStatusIcon).toHaveClass('new-status-icon') it "updates when a git-status-change event occurs", -> fs.write(path, "i've changed for the worse") rootView.open(path) - expect(statusBar.gitStatusIcon).toHaveText('\uf26d') + expect(statusBar.gitStatusIcon).toHaveClass('modified-status-icon') fs.write(path, originalPathText) rootView.getActiveEditor().getBuffer().trigger 'git-status-change' - expect(statusBar.gitStatusIcon).toHaveText('') + expect(statusBar.gitStatusIcon).not.toHaveClass('modified-status-icon') it "updates when the window receives focus", -> fs.write(path, "i've changed for the worse") rootView.open(path) - expect(statusBar.gitStatusIcon).toHaveText('\uf26d') + expect(statusBar.gitStatusIcon).toHaveClass('modified-status-icon') fs.write(path, originalPathText) $(window).trigger 'focus' - expect(statusBar.gitStatusIcon).toHaveText('') + expect(statusBar.gitStatusIcon).not.toHaveClass('modified-status-icon') diff --git a/src/app/status-bar.coffee b/src/app/status-bar.coffee index d12a2ab7f..744304287 100644 --- a/src/app/status-bar.coffee +++ b/src/app/status-bar.coffee @@ -23,7 +23,7 @@ class StatusBar extends View @span class: 'current-path', outlet: 'currentPath' @span class: 'buffer-modified', outlet: 'bufferModified' @div class: 'cursor-position', => - @span class: 'octicons', outlet: 'gitStatusIcon' + @span outlet: 'gitStatusIcon' @span outlet: 'branchArea', => @span class: 'octicons branch-icon' @span class: 'branch-label', outlet: 'branchLabel' @@ -76,10 +76,11 @@ class StatusBar extends View @gitStatusIcon.empty() return unless path + @gitStatusIcon.removeClass().addClass('octicons') if @buffer.getGit()?.isPathModified(path) - @gitStatusIcon.append $$ -> @span '\uf26d', class: 'modified-status-icon' + @gitStatusIcon.addClass('modified-status-icon') else if @buffer.getGit()?.isPathNew(path) - @gitStatusIcon.append $$ -> @span '\uf26b', class: 'new-status-icon' + @gitStatusIcon.addClass('new-status-icon') updatePathText: -> if path = @editor.getPath() diff --git a/static/status-bar.css b/static/status-bar.css index 6542683e6..9554c0455 100644 --- a/static/status-bar.css +++ b/static/status-bar.css @@ -21,11 +21,19 @@ padding-right: 5px; } +.status-bar .modified-status-icon:before { + content: "\f26d"; +} + .status-bar .new-status-icon { color: #269F81; padding-right: 5px; } +.status-bar .new-status-icon:before { + content: "\f26b"; +} + .status-bar .octicons { font-family: 'Octicons Regular'; font-size: 14px;