Sha256: 21655500fd9300bca32ae9c737c677f8d6f8dd4a87b9633cadb261fe2d91c81a

Contents?: true

Size: 1.32 KB

Versions: 2

Compression:

Stored size: 1.32 KB

Contents

<% ActiveScaffold::Bridges::Bridge.run_all unless defined?(ActiveScaffold::Bridges::DatePickerBridge) %>
<%= ActiveScaffold::Bridges::DatePickerBridge.localization %>

$(document).ready(function() {
  $('form.as_form, form.inplace_form').live('as:form_loaded', function(event) {
    var as_form = $(this).closest("form");
    as_form.find('input.datetime_picker').each(function(index) {
      var date_picker = $(this);
      if (typeof(date_picker.datetimepicker) == 'function') {
        date_picker.datetimepicker();
      }
    });

    as_form.find('input.date_picker').each(function(index) {
      var date_picker = $(this);
      if (typeof(date_picker.datepicker) == 'function') {
        date_picker.datepicker();
      }
    });
    return true;
  });
  $('form.as_form, form.inplace_form').live('as:form_unloaded', function(event) {
    var as_form = $(this).closest("form");
    as_form.find('input.datetime_picker').each(function(index) {
      var date_picker = $(this);
      if (typeof(date_picker.datetimepicker) == 'function') {
        date_picker.datetimepicker('destroy');
      }
    });

    as_form.find('input.date_picker').each(function(index) {
      var date_picker = $(this);
      if (typeof(date_picker.datepicker) == 'function') {
        date_picker.datepicker('destroy');
      }
    });
    return true;
  });
});

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
active_scaffold_vho-3.1.5 app/assets/javascripts/jquery/date_picker_bridge.js.erb
active_scaffold_vho-3.1.4 app/assets/javascripts/jquery/date_picker_bridge.js.erb