Add octicon to branch label

This commit is contained in:
Kevin Sawicki
2012-10-25 12:23:54 -07:00
committed by Corey Johnson
parent 88cdff9d26
commit e4fb12a398
5 changed files with 31 additions and 5 deletions

View File

@@ -22,7 +22,11 @@ class StatusBar extends View
@div class: 'file-info', =>
@div class: 'current-path', outlet: 'currentPath'
@div class: 'buffer-modified', outlet: 'bufferModified'
@div class: 'cursor-position', outlet: 'cursorPosition'
@div class: 'cursor-position', =>
@span outlet: 'branchArea', =>
@span '\uf020', class: 'octicons'
@span class: 'branch-label', outlet: 'branchLabel'
@span outlet: 'cursorPosition'
initialize: (@rootView, @editor) ->
@updatePathText()
@@ -58,6 +62,9 @@ class StatusBar extends View
updateCursorPositionText: ->
{ row, column } = @editor.getCursorBufferPosition()
cursorText = "#{row + 1},#{column + 1}"
cursorText = "(#{@head}) #{cursorText}" if @head
@cursorPosition.text(cursorText)
if @head
@branchArea.show()
@branchLabel.text(@head)
else
@branchArea.hide()
@cursorPosition.text("#{row + 1},#{column + 1}")