gitlab-org--gitlab-foss/app/assets/javascripts/flash.js.coffee

17 lines
354 B
CoffeeScript
Raw Normal View History

2014-10-20 16:48:07 -04:00
class @Flash
2016-05-13 01:56:37 -04:00
constructor: (message, type = 'alert')->
@flash = $(".flash-container")
@flash.html("")
innerDiv = $('<div/>',
class: "flash-#{type}",
text: message
)
innerDiv.appendTo(".flash-container")
@flash.click -> $(@).fadeOut()
@flash.show()
pinTo: (selector) ->
@flash.detach().appendTo(selector)