mirror of
https://github.com/atom/atom.git
synced 2026-02-10 14:45:11 -05:00
StatusBar.initialize appends a status bar view to every current and future editor pane
This commit is contained in:
@@ -39,6 +39,7 @@ class Editor extends View
|
||||
softTabs: true
|
||||
tabText: ' '
|
||||
editSessions: null
|
||||
attached: false
|
||||
|
||||
@deserialize: (viewState) ->
|
||||
new Editor(viewState)
|
||||
@@ -188,11 +189,14 @@ class Editor extends View
|
||||
else
|
||||
@gutter.addClass('drop-shadow')
|
||||
|
||||
@on 'attach', =>
|
||||
@on 'attach', (e) =>
|
||||
return if @attached or e.target != this[0]
|
||||
@attached = true
|
||||
@calculateDimensions()
|
||||
@hiddenInput.width(@charWidth)
|
||||
@setMaxLineLength() if @softWrap
|
||||
@focus() if @isFocused
|
||||
@trigger 'editor-open', [this]
|
||||
|
||||
rootView: ->
|
||||
@parents('#root-view').view()
|
||||
|
||||
19
src/app/status-bar.coffee
Normal file
19
src/app/status-bar.coffee
Normal file
@@ -0,0 +1,19 @@
|
||||
{View} = require 'space-pen'
|
||||
|
||||
module.exports =
|
||||
class StatusBar extends View
|
||||
@initialize: (rootView) ->
|
||||
for editor in rootView.editors()
|
||||
@appendToEditorPane(editor)
|
||||
|
||||
rootView.on 'editor-open', (e, editor) =>
|
||||
@appendToEditorPane(editor)
|
||||
|
||||
@appendToEditorPane: (editor) ->
|
||||
if pane = editor.pane()
|
||||
pane.append(new StatusBar(editor))
|
||||
|
||||
@content: ->
|
||||
@div class: 'status-bar'
|
||||
|
||||
initialize: (@editor) ->
|
||||
Reference in New Issue
Block a user