From 4cf8abc786f9edfd62f5c29a4a6c17bf0896dded Mon Sep 17 00:00:00 2001 From: simurai Date: Tue, 27 Oct 2015 17:13:00 +0900 Subject: [PATCH] :art: Rename top/bottom-bar to header/footer --- spec/workspace-element-spec.coffee | 8 ++++---- spec/workspace-spec.coffee | 20 +++++++++---------- src/workspace-element.coffee | 8 ++++---- src/workspace.coffee | 32 +++++++++++++++--------------- 4 files changed, 34 insertions(+), 34 deletions(-) diff --git a/spec/workspace-element-spec.coffee b/spec/workspace-element-spec.coffee index a0f7c2c3b..add0b39c2 100644 --- a/spec/workspace-element-spec.coffee +++ b/spec/workspace-element-spec.coffee @@ -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 diff --git a/spec/workspace-spec.coffee b/spec/workspace-spec.coffee index c28acb43d..57768ba4e 100644 --- a/spec/workspace-spec.coffee +++ b/spec/workspace-spec.coffee @@ -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) diff --git a/src/workspace-element.coffee b/src/workspace-element.coffee index 14adc9d7e..163cdc152 100644 --- a/src/workspace-element.coffee +++ b/src/workspace-element.coffee @@ -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) diff --git a/src/workspace.coffee b/src/workspace.coffee index dbd056c72..d3635becb 100644 --- a/src/workspace.coffee +++ b/src/workspace.coffee @@ -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: ->