gitlab-org--gitlab-foss/app/assets/javascripts/flash.js.coffee
2013-08-27 12:18:53 +03:00

15 lines
310 B
CoffeeScript

class Flash
constructor: (message, type)->
flash = $(".flash-container")
flash.html("")
$('<div/>',
class: "flash-#{type}",
text: message
).appendTo(".flash-container")
flash.click -> $(@).fadeOut()
flash.show()
setTimeout (-> flash.fadeOut()), 5000
@Flash = Flash