Sha256: 71be72d819e5c1316033dfee372de58702a145ec54c80c12190438f8f51ab64e

Contents?: true

Size: 437 Bytes

Versions: 28

Compression:

Stored size: 437 Bytes

Contents

$(document).on 'click', '.add-fields', (e) ->
  # add image inside a form click
  e.preventDefault()

  time = new Date().getTime()
  regexp = new RegExp($(@).data('id'), 'g')
  $(@).before($(@).data('fields').replace(regexp, time))

$(document).on 'click', '.remove-fields', (e) ->
  # remove image inside a form click
  e.preventDefault()
  $(@).prev('input[type=hidden]').val('1')
  $(@).parent().parent().parent().addClass('hidden')

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
adminpanel-2.6.0 app/assets/javascripts/adminpanel/images_form_add_remove_fields.js.coffee
adminpanel-2.5.5 app/assets/javascripts/adminpanel/images_form_add_remove_fields.js.coffee
adminpanel-2.5.4 app/assets/javascripts/adminpanel/images_form_add_remove_fields.js.coffee
adminpanel-2.5.3 app/assets/javascripts/adminpanel/images_form_add_remove_fields.js.coffee
adminpanel-2.5.2 app/assets/javascripts/adminpanel/images_form_add_remove_fields.js.coffee
adminpanel-2.5.1 app/assets/javascripts/adminpanel/images_form_add_remove_fields.js.coffee
adminpanel-2.5.0 app/assets/javascripts/adminpanel/images_form_add_remove_fields.js.coffee
adminpanel-2.4.3 app/assets/javascripts/adminpanel/images_form_add_remove_fields.js.coffee