Sha256: 7f58ba6beb58a9918486c6705f78f7e3367a94d5a901d4d0fabad841ab12b7a8

Contents?: true

Size: 612 Bytes

Versions: 27

Compression:

Stored size: 612 Bytes

Contents

ActiveAdmin.flash =
  class Flash
    @error: (message, close_after) ->
      new @ message, "error", close_after
    @notice: (message, close_after) ->
      new @ message, "notice", close_after
    reference: ->
      @reference
    constructor: (@message, @type = "notice", close_after) ->
      @reference = jQuery("<div>").addClass("flash flash_#{@type}").text(@message)
      jQuery ".flashes"
        .append @reference
      @close_after close_after if close_after?
    close_after: (close_after) ->
      setTimeout =>
        @close()
      , close_after * 1000
    close: ->
      @reference.remove()

Version data entries

27 entries across 27 versions & 4 rubygems

Version Path
activeadmin-1.0.0.pre5 app/assets/javascripts/active_admin/lib/flash.js.coffee
activeadmin-orac-1.0.0.pre4 app/assets/javascripts/active_admin/lib/flash.js.coffee
activeadmin-orac-1.0.0 app/assets/javascripts/active_admin/lib/flash.js.coffee
activeadmin-orac-1.0.0.pre.orac app/assets/javascripts/active_admin/lib/flash.js.coffee
activeadmin-1.0.0.pre4 app/assets/javascripts/active_admin/lib/flash.js.coffee
activeadmin-1.0.0.pre3 app/assets/javascripts/active_admin/lib/flash.js.coffee
activeadmin-1.0.0.pre2 app/assets/javascripts/active_admin/lib/flash.js.coffee