Sha256: 4f90fde5e5c89e34544a9e8e41a1e604b741267af855909b350b9d3868812919

Contents?: true

Size: 800 Bytes

Versions: 7

Compression:

Stored size: 800 Bytes

Contents

# -----------------------------------------------------------------------------
# INPUT HIDDEN
# -----------------------------------------------------------------------------
class @InputHidden
  constructor: (@name, @value, @config, @object) ->
    @$el = $("<input type='hidden' name='#{ @name }' value='#{ @_valueSafe() }' id='#{ @name }' />")

    return this

  _valueSafe: ->
    if typeof(@value) == 'object'
      JSON.stringify(@value)
    else
      _escapeHtml(@value)

  #
  # PUBLIC
  #

  initialize: ->
    @config.onInitialize?(this)

  updateValue: (@value) ->
    @$el.val(@_valueSafe())

  hash: (hash={}) ->
    hash[@config.klassName] = @$el.val()
    return hash

  showErrorMessage: (message) ->
    ;

  hideErrorMessage: ->
    ;


_chrFormInputs['hidden'] = InputHidden




Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
chr-0.2.1 app/assets/javascripts/chr/form/input-hidden.coffee
chr-0.2.0 app/assets/javascripts/chr/form/input-hidden.coffee
chr-0.1.5 app/assets/javascripts/chr/form/input-hidden.coffee
chr-0.1.4 app/assets/javascripts/chr/form/_inputHidden.coffee
chr-0.1.2 app/assets/javascripts/chr/form/_inputHidden.coffee
chr-0.1.1 app/assets/javascripts/chr/form/_inputHidden.coffee
chr-0.1.0 app/assets/javascripts/chr/form/_inputHidden.coffee