Sha256: 6ab54e2389d244e3c0e953fe38b2a8118282701ef7cfe41d2174292ae7229460

Contents?: true

Size: 1.38 KB

Versions: 4

Compression:

Stored size: 1.38 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}
               checked={@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

4 entries across 4 versions & 1 rubygems

Version Path
lanes-0.5.6 client/lanes/components/toolbar/Toolbar.cjsx
lanes-0.5.5 client/lanes/components/toolbar/Toolbar.cjsx
lanes-0.5.0 client/lanes/components/toolbar/Toolbar.cjsx
lanes-0.4.0 client/lanes/components/toolbar/Toolbar.cjsx