Sha256: 445142be40ac71472e1297a4a3f808616782c617d8b1ee401b98d9c4728ffee7

Contents?: true

Size: 862 Bytes

Versions: 10

Compression:

Stored size: 862 Bytes

Contents

# Redraw the table, and initialize any filter form inputs after the last column made visible
$(document).on 'column-visibility.dt', (event, settings, index, state) ->
  return if settings.bDestroying

  $table = $(event.target)

  timeout = $table.data('timeout')
  clearTimeout(timeout) if timeout
  $table.data('timeout', setTimeout( =>
      $table.DataTable().draw()
      $table.trigger('effective-bootstrap:initialize')
    , 700)
  )
  true

# Remove empty label (bulk actions) from ColVis dropdown
$(document).on 'click', 'a.buttons-colvis:not(.initialized)', (event) ->
  $colvis = $('.dt-button-collection')
  return if $colvis.length == 0

  $colvis.find('a > span:empty').each -> $(this).parent().remove()
  $colvis.find('a.buttons-colvisGroup').first().before("<div class='dropdown-divider'></div>")
  $(event.currentTarget).addClass('initialized')

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
effective_datatables-4.2.0 app/assets/javascripts/effective_datatables/events.js.coffee
effective_datatables-4.1.1 app/assets/javascripts/effective_datatables/events.js.coffee
effective_datatables-4.1.0 app/assets/javascripts/effective_datatables/events.js.coffee
effective_datatables-4.0.6 app/assets/javascripts/effective_datatables/events.js.coffee
effective_datatables-4.0.5 app/assets/javascripts/effective_datatables/events.js.coffee
effective_datatables-4.0.4 app/assets/javascripts/effective_datatables/events.js.coffee
effective_datatables-4.0.3 app/assets/javascripts/effective_datatables/events.js.coffee
effective_datatables-4.0.2 app/assets/javascripts/effective_datatables/events.js.coffee
effective_datatables-4.0.1 app/assets/javascripts/effective_datatables/events.js.coffee
effective_datatables-4.0.0 app/assets/javascripts/effective_datatables/events.js.coffee