Skip to content

Instantly share code, notes, and snippets.

@victorcreed
Created February 4, 2014 05:33
Show Gist options
  • Save victorcreed/8798607 to your computer and use it in GitHub Desktop.
Save victorcreed/8798607 to your computer and use it in GitHub Desktop.
flash message in coffee
class @FlashMessage
constructor: (@message, @flashType) ->
initHideFlashMessage: ->
$(".alert").slideUp -> $(this).remove()
hideFlashMessage: ->
setTimeout @initHideFlashMessage, 2000
render: ->
$("header").prepend("<p class='alert alert-#{@flashType} no-radius'>#{@message}</p>")
@hideFlashMessage()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment