Sha256: 6463623143c8764e65f93019e44b01ef7c2a84a4f528e1364bd873a0673c0fb3

Contents?: true

Size: 1.42 KB

Versions: 11

Compression:

Stored size: 1.42 KB

Contents

# Initializers
$(document).on 'ready page:load', ->
  # jQuery datepickers (also evaluates dynamically added HTML)
  $(document).on 'focus', '.datepicker:not(.hasDatepicker)', ->
    defaults = dateFormat: 'yy-mm-dd'
    options = $(@).data 'datepicker-options'
    $(@).datepicker $.extend(defaults, options)

  # Clear Filters button
  $('.clear_filters_btn').click ->
    params = window.location.search.split('&')
    regex = /^(q\[|q%5B|q%5b|page|commit)/
    window.location.search = (param for param in params when not param.match(regex)).join('&')

  # Batch Actions dropdown
  $('.dropdown_button').popover()

  # Filter form: don't send any inputs that are empty
  $('.filter_form').submit ->
    $(@).find(':input').filter(-> @value is '').prop 'disabled', true

  # Filter form: for filters that let you choose the query method from
  # a dropdown, apply that choice to the filter input field.
  $('.filter_form_field.select_and_search select').change ->
    $(@).siblings('input').prop name: "q[#{@value}]"

  # Tab navigation
  $('#active_admin_content .tabs').tabs()

  # In order for index scopes to overflow properly onto the next line, we have
  # to manually set its width based on the width of the batch action button.
  if (batch_actions_selector = $('.table_tools .batch_actions_selector')).length
    batch_actions_selector.next().css
      width: "calc(100% - 10px - #{batch_actions_selector.outerWidth()}px)"
      'float': 'right'

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
yousty-activeadmin-1.0.15.pre app/assets/javascripts/active_admin/application.js.coffee
yousty-activeadmin-1.0.14.pre app/assets/javascripts/active_admin/application.js.coffee
yousty-activeadmin-1.0.13.pre app/assets/javascripts/active_admin/application.js.coffee
yousty-activeadmin-1.0.12.pre app/assets/javascripts/active_admin/application.js.coffee
yousty-activeadmin-1.0.11.pre app/assets/javascripts/active_admin/application.js.coffee
yousty-activeadmin-1.0.10.pre app/assets/javascripts/active_admin/application.js.coffee
yousty-activeadmin-1.0.9.pre app/assets/javascripts/active_admin/application.js.coffee
yousty-activeadmin-1.0.8.pre app/assets/javascripts/active_admin/application.js.coffee
yousty-activeadmin-1.0.7.pre app/assets/javascripts/active_admin/application.js.coffee
yousty-activeadmin-1.0.6.pre app/assets/javascripts/active_admin/application.js.coffee
yousty-activeadmin-1.0.5.pre app/assets/javascripts/active_admin/application.js.coffee