Sha256: 4833cfb56ba2a8f2c25b57e36672453ce9692fcf5f47d94b42cd586d978ea904

Contents?: true

Size: 797 Bytes

Versions: 137

Compression:

Stored size: 797 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").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

137 entries across 137 versions & 1 rubygems

Version Path
alchemy_cms-7.0.15 app/assets/javascripts/alchemy/alchemy.growler.js.coffee
alchemy_cms-6.1.10 app/assets/javascripts/alchemy/alchemy.growler.js.coffee
alchemy_cms-7.0.14 app/assets/javascripts/alchemy/alchemy.growler.js.coffee
alchemy_cms-7.0.13 app/assets/javascripts/alchemy/alchemy.growler.js.coffee
alchemy_cms-7.0.12 app/assets/javascripts/alchemy/alchemy.growler.js.coffee
alchemy_cms-7.0.11 app/assets/javascripts/alchemy/alchemy.growler.js.coffee
alchemy_cms-7.0.10 app/assets/javascripts/alchemy/alchemy.growler.js.coffee
alchemy_cms-7.0.9 app/assets/javascripts/alchemy/alchemy.growler.js.coffee
alchemy_cms-7.0.8 app/assets/javascripts/alchemy/alchemy.growler.js.coffee
alchemy_cms-7.0.7 app/assets/javascripts/alchemy/alchemy.growler.js.coffee
alchemy_cms-7.0.6 app/assets/javascripts/alchemy/alchemy.growler.js.coffee
alchemy_cms-7.0.5 app/assets/javascripts/alchemy/alchemy.growler.js.coffee
alchemy_cms-7.0.4 app/assets/javascripts/alchemy/alchemy.growler.js.coffee
alchemy_cms-7.0.3 app/assets/javascripts/alchemy/alchemy.growler.js.coffee
alchemy_cms-6.1.9 app/assets/javascripts/alchemy/alchemy.growler.js.coffee
alchemy_cms-7.0.2 app/assets/javascripts/alchemy/alchemy.growler.js.coffee
alchemy_cms-6.1.8 app/assets/javascripts/alchemy/alchemy.growler.js.coffee
alchemy_cms-6.1.7 app/assets/javascripts/alchemy/alchemy.growler.js.coffee
alchemy_cms-7.0.1 app/assets/javascripts/alchemy/alchemy.growler.js.coffee
alchemy_cms-7.0.0 app/assets/javascripts/alchemy/alchemy.growler.js.coffee