Rename PaneContainerModel to PaneContainer

This commit is contained in:
Nathan Sobo 2014-01-13 13:56:31 -07:00
parent a268b3e963
commit 97999f1080
4 changed files with 13 additions and 13 deletions

View File

@ -1,7 +1,7 @@
PaneContainerModel = require '../src/pane-container-model'
PaneContainer = require '../src/pane-container'
Pane = require '../src/pane'
describe "PaneContainerModel", ->
describe "PaneContainer", ->
describe "serialization", ->
[containerA, pane1A, pane2A, pane3A] = []
@ -13,7 +13,7 @@ describe "PaneContainerModel", ->
serialize: -> deserializer: 'Item'
pane1A = new Pane(items: [new Item])
containerA = new PaneContainerModel(root: pane1A)
containerA = new PaneContainer(root: pane1A)
pane2A = pane1A.splitRight(items: [new Item])
pane3A = pane2A.splitDown(items: [new Item])
@ -37,7 +37,7 @@ describe "PaneContainerModel", ->
beforeEach ->
pane1 = new Pane
container = new PaneContainerModel(root: pane1)
container = new PaneContainer(root: pane1)
it "references the first pane if no pane has been made active", ->
expect(container.activePane).toBe pane1
@ -68,7 +68,7 @@ describe "PaneContainerModel", ->
beforeEach ->
pane = new Pane
container = new PaneContainerModel(root: pane)
container = new PaneContainer(root: pane)
container.on 'surrendered-focus', surrenderedFocusHandler = jasmine.createSpy("surrenderedFocusHandler")
it "assigns null to the root and the activePane", ->

View File

@ -1,7 +1,7 @@
{Model} = require 'theorist'
Pane = require '../src/pane'
PaneAxis = require '../src/pane-axis'
PaneContainerModel = require '../src/pane-container-model'
PaneContainer = require '../src/pane-container'
describe "Pane", ->
describe "split methods", ->
@ -9,7 +9,7 @@ describe "Pane", ->
beforeEach ->
pane1 = new Pane(items: ["A"])
container = new PaneContainerModel(root: pane1)
container = new PaneContainer(root: pane1)
describe "::splitLeft(params)", ->
describe "when the parent is the container root", ->
@ -104,7 +104,7 @@ describe "Pane", ->
beforeEach ->
pane1 = new Pane(items: [new Model, new Model])
container = new PaneContainerModel(root: pane1)
container = new PaneContainer(root: pane1)
it "destroys the pane's destroyable items", ->
[item1, item2] = pane1.items

View File

@ -1,7 +1,7 @@
Serializable = require 'serializable'
{$, View} = require './space-pen-extensions'
PaneView = require './pane-view'
PaneContainerModel = require './pane-container-model'
PaneContainer = require './pane-container'
# Private: Manages the list of panes within a {WorkspaceView}
module.exports =
@ -10,16 +10,16 @@ class PaneContainerView extends View
Serializable.includeInto(this)
@deserialize: (state) ->
new this(PaneContainerModel.deserialize(state.model))
new this(PaneContainer.deserialize(state.model))
@content: ->
@div class: 'panes'
initialize: (params) ->
if params instanceof PaneContainerModel
if params instanceof PaneContainer
@model = params
else
@model = new PaneContainerModel({root: params?.root?.model})
@model = new PaneContainer({root: params?.root?.model})
@subscribe @model.$root, @onRootChanged
@subscribe @model.$activePaneItem.changes, @onActivePaneItemChanged

View File

@ -3,7 +3,7 @@ Serializable = require 'serializable'
Pane = require './pane'
module.exports =
class PaneContainerModel extends Model
class PaneContainer extends Model
atom.deserializers.add(this)
Serializable.includeInto(this)