Sha256: 9ff6a3f24b8d914e4ebf3af13b3ef8e11d660e342c6f8b92c2ff9b75e2a5d31b

Contents?: true

Size: 951 Bytes

Versions: 17

Compression:

Stored size: 951 Bytes

Contents

# http://eonasdan.github.io/bootstrap-datetimepicker/Options/

initialize = (target) ->
  $(target || document).find('input.effective_date_picker:not(.initialized)').each (i, element) ->
    element = $(element)
    options = element.data('input-js-options') || {}

    element.addClass('initialized').datetimepicker(options)
    element.trigger('dp.end_date_initialized') if (element.attr('name') || '').indexOf('[end_') != -1

$ -> initialize()
$(document).on 'page:change', -> initialize()
$(document).on 'turbolinks:load', -> initialize()
$(document).on 'turbolinks:render', -> initialize()
$(document).on 'cocoon:after-insert', -> initialize()
$(document).on 'effective-form-inputs:initialize', (event) -> initialize(event.currentTarget)

$(document).on 'turbolinks:before-cache', ->
  $('input.effective_date_picker.initialized').each (i, element) ->
    $input = $(element)
    $input.datetimepicker('destroy') if $input.data('datetimepicker')

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
effective_form_inputs-1.5.0 app/assets/javascripts/effective_date_picker/initialize.js.coffee
effective_form_inputs-1.4.1 app/assets/javascripts/effective_date_picker/initialize.js.coffee
effective_form_inputs-1.4.0 app/assets/javascripts/effective_date_picker/initialize.js.coffee
effective_form_inputs-1.3.0 app/assets/javascripts/effective_date_picker/initialize.js.coffee
effective_form_inputs-1.2.9 app/assets/javascripts/effective_date_picker/initialize.js.coffee
effective_form_inputs-1.2.8 app/assets/javascripts/effective_date_picker/initialize.js.coffee
effective_form_inputs-1.2.7 app/assets/javascripts/effective_date_picker/initialize.js.coffee
effective_form_inputs-1.2.6 app/assets/javascripts/effective_date_picker/initialize.js.coffee
effective_form_inputs-1.2.5 app/assets/javascripts/effective_date_picker/initialize.js.coffee
effective_form_inputs-1.2.4 app/assets/javascripts/effective_date_picker/initialize.js.coffee
effective_form_inputs-1.2.3 app/assets/javascripts/effective_date_picker/initialize.js.coffee
effective_form_inputs-1.2.2 app/assets/javascripts/effective_date_picker/initialize.js.coffee
effective_form_inputs-1.2.1 app/assets/javascripts/effective_date_picker/initialize.js.coffee
effective_form_inputs-1.2.0 app/assets/javascripts/effective_date_picker/initialize.js.coffee
effective_form_inputs-1.1.15 app/assets/javascripts/effective_date_picker/initialize.js.coffee
effective_form_inputs-1.1.14 app/assets/javascripts/effective_date_picker/initialize.js.coffee
effective_form_inputs-1.1.13 app/assets/javascripts/effective_date_picker/initialize.js.coffee