Sha256: b3044dce1c9add71fdcba2c404efa0316a0199f50257939c990aa6c2e5e482ae

Contents?: true

Size: 1.38 KB

Versions: 3

Compression:

Stored size: 1.38 KB

Contents

Screen = React.createClass

    displayName: 'Screen'
    shouldComponentUpdate: ->
        false
    render: ->
        React.createElement(@props.screen.component(), @props.screen.props)

class Lanes.Workspace.ScreenView extends Lanes.React.Component
    contextTypes:
        uistate: React.PropTypes.object.isRequired

    dataObjects:
        displaying: -> Lanes.Screens.Definitions.displaying
        allScreens: -> Lanes.Screens.Definitions.all

    bindDataEvents:
        displaying: 'change:active remove add'
        allScreens: 'change:loading'

    renderScreen: (screen) ->
        <div key={screen.id} className={_.classnames("screen", active:screen.active)}>
            <Screen screen={screen} />
        </div>

    renderLoading: ->
        screen = Lanes.Screens.Definitions.all.findWhere(loading: true)
        <LC.NetworkActivityOverlay visible model={screen} message="Loading #{screen.title}…" />

    BaseView: ->
        Base = Lanes.Extensions.controlling().initialScreen?() or Lanes.Workspace.FirstRun
        <div className="screen active base">
            <Base />
        </div>

    render: ->

        child = if @displaying.isEmpty() then <@BaseView /> else @displaying.map(@renderScreen)
        <div className={"page-content #{@context.uistate.layout_size}"}>
            {@renderLoading() if Lanes.Screens.Definitions.all.isLoading()}
            {child}
        </div>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
lanes-0.5.6 client/lanes/workspace/ScreenView.cjsx
lanes-0.5.5 client/lanes/workspace/ScreenView.cjsx
lanes-0.5.0 client/lanes/workspace/ScreenView.cjsx