$(function () {
  $('.chosen-select').on('change', function () {
    $('#asset-filter-form').submit()
  })

  $('.select2').on('change', function () {
    $('#asset-filter-form').submit()
  })

  $('#data_1 .input-group.date')
    .datepicker()
    .on('changeDate', function () {
      $('#asset-filter-form').submit()
    })

  $('#data_1 .input-group.date')
    .datepicker()
    .on('clearDate', function () {
      $('#asset-filter-form').submit()
    })

  $(
    '#asset_age, .depreciation, .radio-button, #show_linked, #show_individual'
  ).on('keyup change', function () {
    $('#asset-filter-form').submit()
  })

  $('#asset_age_unit').on('change', function () {
    $('#asset-filter-form').submit()
  })

  $('.filter-field, .filter-field-user, .filter-field-location').on(
    'change',
    function () {
      $('#asset-filter-form').submit()
    }
  )
})
