Commit 9231baf25d9576675ba31bcc380cc5813d6b9f07

Authored by Daniela Feitosa
2 parents 9ece558f d693abc4

Merge branch 'fix-custom_forms-small-bugs' into 'master'

custom_forms: small bug fixes in datepick and remove field

- Fixes slide up of field box when removing a field, since the outer
  box was being left behind and only the content was being slided up.
- Fixes date pick on Firefox/Iceweasel, which was not showing the date
  stored on the database and instead was always being initialized with
  the current date because the format with dashes '1995-12-17 03:24:00'
  is not a valid date format for Date(), while '1995-12-17T03:24:00' or
  '1995/12/17 03:24:00' are correct formats.

See merge request !703
plugins/custom_forms/public/field.js
... ... @@ -40,7 +40,7 @@ var customFormsPlugin = {
40 40 if (confirm(confirmMsg)) {
41 41 fb = jQuery(button).closest('.field-box');
42 42 jQuery('input.destroy-field', fb).val(1);
43   - jQuery('> div', fb).slideUp({easing:'linear', complete:function(){fb.slideUp({easing:'linear', duration:250})}});
  43 + jQuery(fb).slideUp(600, 'linear');
44 44 }
45 45 },
46 46  
... ...
plugins/custom_forms/views/custom_forms_plugin_myprofile/_form.html.erb
... ... @@ -5,7 +5,7 @@
5 5 <%= required labelled_form_field _('Name'), f.text_field(:name) %>
6 6 <%= labelled_form_field(_('What is the time limit for this form to be filled?'), (
7 7 date_range_field('form[begining]', 'form[ending]', @form.begining, @form.ending,
8   - '%Y-%m-%d %H:%M',
  8 + '%Y/%m/%d %H:%M',
9 9 { :time => true, :change_month => true, :change_year => true,
10 10 :date_format => 'yy-mm-dd', :time_format => 'hh:mm' },
11 11 { :size => 14 })
... ...