mirror of
https://github.com/atom/atom.git
synced 2026-02-05 12:15:07 -05:00
25 lines
637 B
CoffeeScript
25 lines
637 B
CoffeeScript
$ = require 'jquery'
|
|
{View} = require 'space-pen'
|
|
|
|
module.exports =
|
|
class PaneGrid extends View
|
|
@deserialize: ({children}, rootView) ->
|
|
childViews = children.map (child) -> rootView.deserializeView(child)
|
|
new this(childViews)
|
|
|
|
initialize: (children=[]) ->
|
|
@append(children...)
|
|
|
|
serialize: ->
|
|
viewClass: @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()
|