Skip to content

Instantly share code, notes, and snippets.

@LBRapid
Created July 9, 2013 15:37
Show Gist options
  • Select an option

  • Save LBRapid/5958374 to your computer and use it in GitHub Desktop.

Select an option

Save LBRapid/5958374 to your computer and use it in GitHub Desktop.
$ ->
class ParametersForm
constructor: (el) ->
@el = $(el)
@setupEventHandlers()
@
setupEventHandlers: ->
@el.find('#parameter_data_type').change ->
if $(@).val() == 'list'
@showListFields()
showListFields: ->
template = JST['templates/parameters/list_fields']
@el.find('.value-fields').html(template())
if $('#parameters-form').length > 0
form = new ParametersForm('#parameters-form')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment