Skip to content

Commit

Permalink
Fixed js add and remove questions
Browse files Browse the repository at this point in the history
  • Loading branch information
hugosantosred committed Feb 13, 2015
1 parent 84dc833 commit 657bf99
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions app/assets/javascripts/spree/backend/spree_faq.js.coffee
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#= require spree/backend

(($) ->
$(@).ready( ->
$('form').on 'click', '.add_fields', ->
time = new Date().getTime()
regexp = new RegExp($(this).data('id'), 'g')
Expand All @@ -15,9 +15,8 @@
$('#new_question_link').on 'click', ->
$('#questions').append(new_question_html.replace(/NEW_RECORD/g, $('#questions .question').size()))
$('#questions .question:last .remove').on 'click', ->
$(this).parent('.question').remove()
$(this).parents('.question').remove()

$.scrollTo($('#questions .question:last'), 800)
$('.question:last input:first').focus()

) jQuery
)

0 comments on commit 657bf99

Please sign in to comment.