Fix failure of some notices to close. #822
This commit is contained in:
parent
82cf0c594f
commit
1a9bd32be4
@ -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?()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user