trigger datepicker when planting finished checkbox is ticked

This commit is contained in:
Taylor Griffin
2014-10-15 06:41:28 +11:00
parent 3a46a5bd18
commit 6bcb9dae4a
2 changed files with 8 additions and 3 deletions

View File

@@ -83,6 +83,10 @@ group :development do
# Installation of the debugger gem fails on Travis CI,
# so we don't use it in the test environment
gem 'debugger'
# A debugger and irb alternative. Pry doesn't play nice
# with unicorn, so start a Webrick server when debugging
# with Pry
gem 'pry'
gem 'better_errors'
gem 'binding_of_caller'
gem 'letter_opener'
@@ -119,7 +123,6 @@ gem 'omniauth-flickr', '>= 0.0.15'
gem 'rake', '>= 10.0.0'
group :development, :test do
gem 'pry'
gem 'haml-rails' # HTML templating language
gem 'rspec-rails', '~> 2.12.1' # unit testing framework
gem 'database_cleaner', '~> 1.3.0'

View File

@@ -1,7 +1,7 @@
# Clears the finished at date field when
# a planting is marked unfinished, and
# repopulates the field with a cached value
# marking unfinshed is undone.
# marking unfinished is undone.
jQuery ->
previousValue = ''
@@ -10,7 +10,9 @@ jQuery ->
if @checked
if previousValue.length
date = previousValue
finished.val(date)
finished.val(date)
else
finished.trigger('focus')
else
previousValue = finished.val()
finished.val('')