debian-mirror-gitlab/app/assets/javascripts/flash.js.coffee

17 lines
344 B
CoffeeScript
Raw Normal View History

2015-04-26 12:48:37 +05:30
class @Flash
2014-09-02 18:07:02 +05:30
constructor: (message, type)->
2015-12-23 02:04:40 +05:30
@flash = $(".flash-container")
@flash.html("")
2014-09-02 18:07:02 +05:30
2015-12-23 02:04:40 +05:30
innerDiv = $('<div/>',
2014-09-02 18:07:02 +05:30
class: "flash-#{type}",
text: message
2015-12-23 02:04:40 +05:30
)
innerDiv.appendTo(".flash-container")
2014-09-02 18:07:02 +05:30
2015-12-23 02:04:40 +05:30
@flash.click -> $(@).fadeOut()
@flash.show()
pinTo: (selector) ->
@flash.detach().appendTo(selector)