debian-mirror-gitlab/app/assets/javascripts/flash.js.coffee
2015-12-23 02:04:40 +05:30

16 lines
344 B
CoffeeScript

class @Flash
constructor: (message, type)->
@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)