Sha256: 1c21e8964e3918c3b86bbc4a19691a7690d71e37a4920c31b252f881cfe521d6

Contents?: true

Size: 629 Bytes

Versions: 2

Compression:

Stored size: 629 Bytes

Contents

# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
jQuery ->
  $('form').on 'click', '.remove_fields', (event) ->
    $(this).prev('input[type=hidden]').val('1')
    $(this).closest('fieldset').hide()
    event.preventDefault()

  $('form').on 'click', '.add_fields', (event) ->
    time = new Date().getTime()
    regexp = new RegExp($(this).data('id'), 'g')
    $(this).before($(this).data('fields').replace(regexp, time))
    event.preventDefault()

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
guara-0.0.3 app/assets/javascripts/crm.js.coffee
guara-0.0.1.rc app/assets/javascripts/crm.js.coffee