mirror of
https://github.com/atom/atom.git
synced 2026-02-15 00:55:14 -05:00
PaneGrid is a superclass of PaneRow and PaneColumn. These are both a type of axis for the pane layout system.
25 lines
617 B
CoffeeScript
25 lines
617 B
CoffeeScript
$ = require 'jquery'
|
|
{View} = require 'space-pen'
|
|
|
|
module.exports =
|
|
class PaneAxis extends View
|
|
@deserialize: ({children}) ->
|
|
childViews = children.map (child) -> deserialize(child)
|
|
new this(childViews)
|
|
|
|
initialize: (children=[]) ->
|
|
@append(children...)
|
|
|
|
serialize: ->
|
|
deserializer: @className()
|
|
children: @childViewStates()
|
|
|
|
childViewStates: ->
|
|
$(child).view().serialize() for child in @children()
|
|
|
|
horizontalChildUnits: ->
|
|
$(child).view().horizontalGridUnits() for child in @children()
|
|
|
|
verticalChildUnits: ->
|
|
$(child).view().verticalGridUnits() for child in @children()
|