gitlab-org--gitlab-foss/app/assets/javascripts/flash.js.coffee
Alfredo Sumaran 5ea0165175 Enhancements
2016-06-03 17:14:23 -05:00

16 lines
354 B
CoffeeScript

class @Flash
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)