Sha256: b05189bcc3f55e9e9497f538d9a95c6d51c0d165e149b7aa1d057b43e36984ff
Contents?: true
Size: 1.25 KB
Versions: 11
Compression:
Stored size: 1.25 KB
Contents
# ----------------------------------------------------------------------------- # Author: Alexander Kravets <alex@slatestudio.com>, # Slate Studio (http://www.slatestudio.com) # # Coding Guide: # https://github.com/thoughtbot/guides/tree/master/style/coffeescript # ----------------------------------------------------------------------------- # ----------------------------------------------------------------------------- # INPUT HIDDEN # ----------------------------------------------------------------------------- class @InputHidden constructor: (@name, @value, @config, @object) -> @_create_el() return this # PRIVATE =============================================== _create_el: -> @$el =$ "<input type='hidden' name='#{ @name }' value='#{ @_safe_value() }' />" _safe_value: -> if typeof(@value) == 'object' return JSON.stringify(@value) else _escapeHtml(@value) # PUBLIC ================================================ showErrorMessage: (message) -> ; hideErrorMessage: -> ; initialize: -> @config.onInitialize?(this) hash: (hash={}) -> hash[@config.klassName] = @$el.val() return hash updateValue: (@value) -> @$el.val(@value) chr.formInputs['hidden'] = InputHidden
Version data entries
11 entries across 11 versions & 2 rubygems