🎨 Rename top/bottom-bar to header/footer

This commit is contained in:
simurai
2015-10-27 17:13:00 +09:00
committed by Ben Ogle
parent b9cea80d4f
commit 4cf8abc786
4 changed files with 34 additions and 34 deletions

View File

@@ -72,10 +72,10 @@ describe "WorkspaceElement", ->
expect(topContainer.nextSibling).toBe workspaceElement.paneContainer
expect(bottomContainer.previousSibling).toBe workspaceElement.paneContainer
topBarContainer = workspaceElement.querySelector('atom-panel-container.top-bar')
bottomBarContainer = workspaceElement.querySelector('atom-panel-container.bottom-bar')
expect(topBarContainer.nextSibling).toBe workspaceElement.horizontalAxis
expect(bottomBarContainer.previousSibling).toBe workspaceElement.horizontalAxis
headerContainer = workspaceElement.querySelector('atom-panel-container.header')
footerContainer = workspaceElement.querySelector('atom-panel-container.footer')
expect(headerContainer.nextSibling).toBe workspaceElement.horizontalAxis
expect(footerContainer.previousSibling).toBe workspaceElement.horizontalAxis
modalContainer = workspaceElement.querySelector('atom-panel-container.modal')
expect(modalContainer.parentNode).toBe workspaceElement

View File

@@ -894,33 +894,33 @@ describe "Workspace", ->
expect(itemView instanceof TestItemElement).toBe(true)
expect(itemView.getModel()).toBe(model)
describe '::addTopBarPanel(model)', ->
describe '::addHeaderPanel(model)', ->
it 'adds a panel to the correct panel container', ->
expect(atom.workspace.getTopBarPanels().length).toBe(0)
atom.workspace.panelContainers.topBar.onDidAddPanel addPanelSpy = jasmine.createSpy()
expect(atom.workspace.getHeaderPanels().length).toBe(0)
atom.workspace.panelContainers.header.onDidAddPanel addPanelSpy = jasmine.createSpy()
model = new TestItem
panel = atom.workspace.addTopBarPanel(item: model)
panel = atom.workspace.addHeaderPanel(item: model)
expect(panel).toBeDefined()
expect(addPanelSpy).toHaveBeenCalledWith({panel, index: 0})
itemView = atom.views.getView(atom.workspace.getTopBarPanels()[0].getItem())
itemView = atom.views.getView(atom.workspace.getHeaderPanels()[0].getItem())
expect(itemView instanceof TestItemElement).toBe(true)
expect(itemView.getModel()).toBe(model)
describe '::addBottomBarPanel(model)', ->
describe '::addFooterPanel(model)', ->
it 'adds a panel to the correct panel container', ->
expect(atom.workspace.getBottomBarPanels().length).toBe(0)
atom.workspace.panelContainers.bottomBar.onDidAddPanel addPanelSpy = jasmine.createSpy()
expect(atom.workspace.getFooterPanels().length).toBe(0)
atom.workspace.panelContainers.footer.onDidAddPanel addPanelSpy = jasmine.createSpy()
model = new TestItem
panel = atom.workspace.addBottomBarPanel(item: model)
panel = atom.workspace.addFooterPanel(item: model)
expect(panel).toBeDefined()
expect(addPanelSpy).toHaveBeenCalledWith({panel, index: 0})
itemView = atom.views.getView(atom.workspace.getBottomBarPanels()[0].getItem())
itemView = atom.views.getView(atom.workspace.getFooterPanels()[0].getItem())
expect(itemView instanceof TestItemElement).toBe(true)
expect(itemView.getModel()).toBe(model)

View File

@@ -74,8 +74,8 @@ class WorkspaceElement extends HTMLElement
left: @views.getView(@model.panelContainers.left)
right: @views.getView(@model.panelContainers.right)
bottom: @views.getView(@model.panelContainers.bottom)
topBar: @views.getView(@model.panelContainers.topBar)
bottomBar: @views.getView(@model.panelContainers.bottomBar)
header: @views.getView(@model.panelContainers.header)
footer: @views.getView(@model.panelContainers.footer)
modal: @views.getView(@model.panelContainers.modal)
@horizontalAxis.insertBefore(@panelContainers.left, @verticalAxis)
@@ -84,8 +84,8 @@ class WorkspaceElement extends HTMLElement
@verticalAxis.insertBefore(@panelContainers.top, @paneContainer)
@verticalAxis.appendChild(@panelContainers.bottom)
@insertBefore(@panelContainers.topBar, @horizontalAxis)
@appendChild(@panelContainers.bottomBar)
@insertBefore(@panelContainers.header, @horizontalAxis)
@appendChild(@panelContainers.footer)
@appendChild(@panelContainers.modal)

View File

@@ -47,8 +47,8 @@ class Workspace extends Model
left: new PanelContainer({location: 'left'})
right: new PanelContainer({location: 'right'})
bottom: new PanelContainer({location: 'bottom'})
topBar: new PanelContainer({location: 'top-bar'})
bottomBar: new PanelContainer({location: 'bottom-bar'})
header: new PanelContainer({location: 'header'})
footer: new PanelContainer({location: 'footer'})
modal: new PanelContainer({location: 'modal'})
@subscribeToEvents()
@@ -68,8 +68,8 @@ class Workspace extends Model
left: new PanelContainer({location: 'left'})
right: new PanelContainer({location: 'right'})
bottom: new PanelContainer({location: 'bottom'})
topBar: new PanelContainer({location: 'top-bar'})
bottomBar: new PanelContainer({location: 'bottom-bar'})
header: new PanelContainer({location: 'header'})
footer: new PanelContainer({location: 'footer'})
modal: new PanelContainer({location: 'modal'})
@originalFontSize = null
@@ -838,11 +838,11 @@ class Workspace extends Model
addTopPanel: (options) ->
@addPanel('top', options)
# Essential: Get an {Array} of all the panel items at the top of the window.
getTopBarPanels: ->
@getPanels('topBar')
# Essential: Get an {Array} of all the panel items in the header.
getHeaderPanels: ->
@getPanels('header')
# Essential: Adds a panel item to the top of the window. It will take up full width.
# Essential: Adds a panel item to the header.
#
# * `options` {Object}
# * `item` Your panel content. It can be DOM element, a jQuery element, or
@@ -854,14 +854,14 @@ class Workspace extends Model
# forced closer to the edges of the window. (default: 100)
#
# Returns a {Panel}
addTopBarPanel: (options) ->
@addPanel('topBar', options)
addHeaderPanel: (options) ->
@addPanel('header', options)
# Essential: Get an {Array} of all the panel items at the bottom of the window.
getBottomBarPanels: ->
@getPanels('bottomBar')
# Essential: Get an {Array} of all the panel items in the footer.
getFooterPanels: ->
@getPanels('footer')
# Essential: Adds a panel item to the bottom of the window. It will take up full width.
# Essential: Adds a panel item to the footer.
#
# * `options` {Object}
# * `item` Your panel content. It can be DOM element, a jQuery element, or
@@ -873,8 +873,8 @@ class Workspace extends Model
# forced closer to the edges of the window. (default: 100)
#
# Returns a {Panel}
addBottomBarPanel: (options) ->
@addPanel('bottomBar', options)
addFooterPanel: (options) ->
@addPanel('footer', options)
# Essential: Get an {Array} of all the modal panel items
getModalPanels: ->