Sha256: cc8d3b41a639b3100ac31c13398e50472c51892cce4a80734522d78beb7a2b72

Contents?: true

Size: 742 Bytes

Versions: 1

Compression:

Stored size: 742 Bytes

Contents

Lanes.React.Mixins.FieldErrors = {


    componentWillMount: ->
        @getInvalidModel()?.maskInvalidFields?()

    getInvalidFieldName: ->
        @props.validity_attribute || @props.name

    getInvalidModel: ->
        @props.model || _.first _.values @data?.states

    isFieldValueInvalid: ->
        !!@fieldInvalidValueMessage()

    fieldInvalidValueMessage: ->
        # check needs to stay in sync with Lanes.React.Mixins.ReadEditingState.isEditingRecord
        return '' unless @props.editOnly or @context.recordDisplay == 'edit'

        @getInvalidModel()?.invalidMessageFor?(
            @getInvalidFieldName()
        )

    onFieldInteraction: ->
        @getInvalidModel()?.unmaskInvalidField?( @getInvalidFieldName() )
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lanes-0.7.0 client/lanes/react/mixins/FieldErrors.coffee