Sha256: bb135760d41ae27e41655cc88e2f4ae6b5828ddfdf48bb4158887cc0cf84763b

Contents?: true

Size: 735 Bytes

Versions: 1

Compression:

Stored size: 735 Bytes

Contents

#= require spree/backend

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

  $('form').on 'click', '.remove', ->
    $(this).parent('.question').children(':hidden[id$=delete]').val(1)
    $(this).parent('.question').slideUp('slow')
    event.preventDefault()

  $('#new_question_link').on 'click', ->
    $('#questions').append(new_question_html.replace(/NEW_RECORD/g, $('#questions .question').size()))
    $('#questions .question:last .remove').on 'click', ->
      $(this).parents('.question').remove()

    $('.question:last input:first').focus()

)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
spree-faq-2.4.0 app/assets/javascripts/spree/backend/spree_faq.js.coffee