Sha256: 871e48dc1be6bb7a228140d6b7a9d0e4c25fff123ea53d513918177322fd254b

Contents?: true

Size: 803 Bytes

Versions: 17

Compression:

Stored size: 803 Bytes

Contents

window.Alchemy = {} if typeof (window.Alchemy) is "undefined"

Alchemy.Growler =

  build: (message, flash_type) ->
    $flash_container = $("<div class=\"flash #{flash_type}\" />")
    $flash_container.append Alchemy.messageIcon(flash_type)
    $flash_container.append message
    $("#flash_notices").append $flash_container
    $("#flash_notices").show()
    Alchemy.Growler.fade()

  fade: ->
    $(".flash:not(.error)", "#flash_notices").delay(5000).queue(-> Alchemy.Growler.dismiss(this))
    $(".flash", "#flash_notices").on("click", (e) => @dismiss(e.currentTarget))
    return

  dismiss: (element) ->
    $(element).on 'transitionend', => $(element).remove()
    $(element).addClass('dismissed')
    return

Alchemy.growl = (message, style = "notice") ->
  Alchemy.Growler.build message, style

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
alchemy_cms-7.1.13 app/assets/javascripts/alchemy/alchemy.growler.js.coffee
alchemy_cms-7.1.12 app/assets/javascripts/alchemy/alchemy.growler.js.coffee
alchemy_cms-7.1.11 app/assets/javascripts/alchemy/alchemy.growler.js.coffee
alchemy_cms-7.1.10 app/assets/javascripts/alchemy/alchemy.growler.js.coffee
alchemy_cms-7.1.9 app/assets/javascripts/alchemy/alchemy.growler.js.coffee
alchemy_cms-7.1.8 app/assets/javascripts/alchemy/alchemy.growler.js.coffee
alchemy_cms-7.1.7 app/assets/javascripts/alchemy/alchemy.growler.js.coffee
alchemy_cms-7.1.6 app/assets/javascripts/alchemy/alchemy.growler.js.coffee
alchemy_cms-7.1.5 app/assets/javascripts/alchemy/alchemy.growler.js.coffee
alchemy_cms-7.1.4 app/assets/javascripts/alchemy/alchemy.growler.js.coffee
alchemy_cms-7.1.3 app/assets/javascripts/alchemy/alchemy.growler.js.coffee
alchemy_cms-7.1.2 app/assets/javascripts/alchemy/alchemy.growler.js.coffee
alchemy_cms-7.1.1 app/assets/javascripts/alchemy/alchemy.growler.js.coffee
alchemy_cms-7.1.0 app/assets/javascripts/alchemy/alchemy.growler.js.coffee
alchemy_cms-7.1.0.pre.rc1 app/assets/javascripts/alchemy/alchemy.growler.js.coffee
alchemy_cms-7.1.0.pre.b2 app/assets/javascripts/alchemy/alchemy.growler.js.coffee
alchemy_cms-7.1.0.pre.b1 app/assets/javascripts/alchemy/alchemy.growler.js.coffee