Merge pull request #1030 from CloCkWeRX/fix_998

Ensure we look at the current control, not the entire collection when marking planting finished
This commit is contained in:
Cesy
2016-08-16 08:50:30 +01:00
committed by GitHub

View File

@@ -8,13 +8,12 @@ jQuery ->
el.datepicker({'format': 'yyyy-mm-dd'})
href = el.attr('href')
el.click (e) ->
e.stopPropagation()
e.preventDefault()
originalText = $(this).text()
href = $(this).attr('href')
$(this).text('Confirm without date')
$(this).bind('click.confirm', (e) ->
@@ -30,6 +29,8 @@ jQuery ->
el.one 'changeDate', ->
date = $(this).datepicker('getDate')
href = $(this).attr('href')
url = "#{href}&planting[finished_at]=#{date}"
link = $("<a href='#{url}' data-method='put'></a>")