Sha256: 2537466386437417263dbb92f63530f0a3bc28a5b5f43773acebc0d4dd4f36b1

Contents?: true

Size: 820 Bytes

Versions: 66

Compression:

Stored size: 820 Bytes

Contents

flash = (message, status = '') ->
  @context[0].oFeatures.bProcessing = false

  message ||= 'Processing...'

  if status == 'danger'
    message = 'Error: ' + message

  $processing = $(@table().node()).siblings('.dataTables_processing')

  if status.length > 0
    $processing.addClass("alert-#{status}")

  $processing.html(message).show()

  timeout = $processing.data('timeout')
  clearTimeout(timeout) if timeout

  delay = (if status == 'danger' then 4000 else 1000)

  $processing.html(message).data('timeout', setTimeout( =>
      $processing.html('Processing...')
      $processing.removeClass('alert-success alert-info alert-warning alert-danger alert-error')
      $processing.hide()
      @context[0].oFeatures.bProcessing = true
    , delay)
  )

  return @

$.fn.DataTable.Api.register('flash()', flash);

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
effective_datatables-4.30.1 app/assets/javascripts/effective_datatables/flash.js.coffee
effective_datatables-4.30.0 app/assets/javascripts/effective_datatables/flash.js.coffee
effective_datatables-4.29.0 app/assets/javascripts/effective_datatables/flash.js.coffee
effective_datatables-4.26.0 app/assets/javascripts/effective_datatables/flash.js.coffee
effective_datatables-4.25.3 app/assets/javascripts/effective_datatables/flash.js.coffee
effective_datatables-4.25.2 app/assets/javascripts/effective_datatables/flash.js.coffee
effective_datatables-4.25.1 app/assets/javascripts/effective_datatables/flash.js.coffee
effective_datatables-4.25.0 app/assets/javascripts/effective_datatables/flash.js.coffee
effective_datatables-4.24.2 app/assets/javascripts/effective_datatables/flash.js.coffee
effective_datatables-4.24.1 app/assets/javascripts/effective_datatables/flash.js.coffee
effective_datatables-4.24.0 app/assets/javascripts/effective_datatables/flash.js.coffee
effective_datatables-4.23.0 app/assets/javascripts/effective_datatables/flash.js.coffee
effective_datatables-4.22.3 app/assets/javascripts/effective_datatables/flash.js.coffee
effective_datatables-4.22.2 app/assets/javascripts/effective_datatables/flash.js.coffee
effective_datatables-4.22.1 app/assets/javascripts/effective_datatables/flash.js.coffee
effective_datatables-4.22.0 app/assets/javascripts/effective_datatables/flash.js.coffee
effective_datatables-4.21.1 app/assets/javascripts/effective_datatables/flash.js.coffee
effective_datatables-4.21.0 app/assets/javascripts/effective_datatables/flash.js.coffee
effective_datatables-4.20.6 app/assets/javascripts/effective_datatables/flash.js.coffee
effective_datatables-4.20.5 app/assets/javascripts/effective_datatables/flash.js.coffee