Fix failure of some notices to close. #822

This commit is contained in:
ccd0 2016-04-17 21:31:50 -07:00
parent 82cf0c594f
commit 1a9bd32be4

View File

@ -15,6 +15,7 @@ class Notice
@el.className = "notification #{type}"
add: =>
return if @closed
if d.hidden
$.on d, 'visibilitychange', @add
return
@ -25,6 +26,7 @@ class Notice
setTimeout @close, @timeout * $.SECOND if @timeout
close: =>
@closed = true
$.off d, 'visibilitychange', @add
$.rm @el
@onclose?()