vendor/assets/javascripts/dvl/flashes.coffee in dvl-flashes-0.0.1 vs vendor/assets/javascripts/dvl/flashes.coffee in dvl-flashes-0.0.2
- old
+ new
@@ -11,23 +11,27 @@
if alertType instanceof jQuery
$alert = alertType
else
$alert = $("""
<div class="flash flash_#{alertType}">
- <a class='close'>×</a>
- #{message}
+ <a class='flash_close'>×</a>
+ <span>#{message}</span>
</div>
""").appendTo("body")
- setTimeout ( -> $alert.addClass 'in' ), 0
+ setTimeout ->
+ $alert.addClass 'is_visible'
+ , 0
mousedOver = undefined
timeoutExpired = undefined
hide = ->
- $alert.removeClass 'in'
- setTimeout ( -> $alert.remove() ), TRANSITION_LENGTH
+ $alert.removeClass 'is_visible'
+ setTimeout ->
+ $alert.remove()
+ , TRANSITION_LENGTH
setTimeout ->
hide() unless mousedOver
timeoutExpired = true
, lengthInMilliseconds || FLASH_ALERT_LENGTH
@@ -37,8 +41,8 @@
$alert.one 'mouseout', ->
mousedOver = undefined
hide() if timeoutExpired
- $alert.on 'click', '.close', ->
+ $alert.on 'click', '.flash_close', ->
mousedOver = undefined
hide()