Sha256: e8d1a10e3b9e8babc8a5f98c0961fae07fa0264e90a7350750144a794521a5a0

Contents?: true

Size: 526 Bytes

Versions: 6

Compression:

Stored size: 526 Bytes

Contents

window.Glow =
  flash: (type, message) -> $(document).trigger 'glow:flash', { type, message }

$(document).ajaxComplete (evt, xhr, options) ->
  type = xhr.getResponseHeader('X-Message-Type')
  message = xhr.getResponseHeader('X-Message')
  Glow.flash type, $('<div/>').html(message).text() if type and message

window.Flash =
  fire: Glow.flash
  # convenience methods
  success: (message) -> Glow.flash 'success', message
  notice: (message) -> Glow.flash 'notice', message
  error: (message) -> Glow.flash 'error', message

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
glow-0.0.16 src/glow.coffee
glow-0.0.15 src/glow.coffee
glow-0.0.14 src/glow.coffee
glow-0.0.13 src/glow.coffee
glow-0.0.12 src/glow.coffee
glow-0.0.11 src/glow.coffee