Sha256: d6120484ba77f0aa8b544ebf282b46a078010506222fe602794b491ee0663df9

Contents?: true

Size: 1.39 KB

Versions: 1

Compression:

Stored size: 1.39 KB

Contents

##= require_self
##= require ./SaveButton

class Lanes.Components.Toolbar extends Lanes.React.Component

    propTypes:
        toggleEdit: Lanes.PropTypes.Model
        commands: React.PropTypes.object.isRequired

    dataObjects:
        changedModel: -> @props.commands.getModel()

    bindDataEvents:
        changedModel: 'remote-update isSavable'

    renderResetButton: ->
        <BS.Button navItem componentClass="button"
            onClick={@props.commands.resetModel} className="reset navbar-btn control">
            <LC.Icon type="undo" />Reset
        </BS.Button>

    EditToggle: ->
        return null unless @props.commands.canEditModel()
        <li navItem className="toggle control">
           <label>
               <Lanes.Vendor.ReactToggle
               aria-labelledby="Editing"
               onChange={@props.commands.toggleEdit}
               defaultChecked={@props.commands.isEditing()} />
               <span>Edit</span>
            </label>
        </li>

    renderSpacer: ->
        <span className="control spacer" />

    render: ->
        <BS.Nav bsStyle="pills" className="lanes-toolbar">
            <Lanes.Components.Toolbar.SaveButton commands={@props.commands} />
            {@renderResetButton()}
            {@props.children}
            <div className="spacer"/>
            <@EditToggle />
            <LC.Toolbar.RemoteChangeSets model=@changedModel />
        </BS.Nav>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lanes-0.3.0 client/lanes/components/toolbar/Toolbar.cjsx