Sha256: 46777e62c09602f8994ec5d6a1622dc575babcf4dc4b9f8751be7898af283a5e

Contents?: true

Size: 606 Bytes

Versions: 1

Compression:

Stored size: 606 Bytes

Contents

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).data('enclosing')).prepend($(this).data('fields').replace(regexp, time))
    event.preventDefault()
  
  $('#children').sortable({ items: '.embedded-child'})  

  $('form').on 'submit', (event) ->
    $("#content_child_order").val($("#children").sortable('toArray'))

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
common-content-0.0.5 app/assets/javascripts/contents.js.coffee