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}"
|
@el.className = "notification #{type}"
|
||||||
|
|
||||||
add: =>
|
add: =>
|
||||||
|
return if @closed
|
||||||
if d.hidden
|
if d.hidden
|
||||||
$.on d, 'visibilitychange', @add
|
$.on d, 'visibilitychange', @add
|
||||||
return
|
return
|
||||||
@ -25,6 +26,7 @@ class Notice
|
|||||||
setTimeout @close, @timeout * $.SECOND if @timeout
|
setTimeout @close, @timeout * $.SECOND if @timeout
|
||||||
|
|
||||||
close: =>
|
close: =>
|
||||||
|
@closed = true
|
||||||
$.off d, 'visibilitychange', @add
|
$.off d, 'visibilitychange', @add
|
||||||
$.rm @el
|
$.rm @el
|
||||||
@onclose?()
|
@onclose?()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user