Start desktop notification closing timeout only after they appeared.

This commit is contained in:
Mayhem 2013-08-26 21:31:30 +02:00
parent 386888e4d1
commit 5c36d646a5
2 changed files with 13 additions and 10 deletions

View File

@ -104,9 +104,10 @@ Unread =
notif.onclick = ->
Header.scrollToPost post.nodes.root
window.focus()
setTimeout ->
notif.close()
, 7 * $.SECOND
notif.onshow = ->
setTimeout ->
notif.close()
, 7 * $.SECOND
onUpdate: (e) ->
if e.detail[404]

View File

@ -122,10 +122,11 @@ QR =
# Firefox automatically closes notifications
# so we can't control the onclose properly.
notif.onclose = -> notice.close()
setTimeout ->
notif.onclose = null
notif.close()
, 7 * $.SECOND
notif.onshow = ->
setTimeout ->
notif.onclose = null
notif.close()
, 7 * $.SECOND
<% } %>
notifications: []
cleanNotifications: ->
@ -1108,9 +1109,10 @@ QR =
QR.open()
QR.captcha.nodes.input.focus()
window.focus()
setTimeout ->
notif.close()
, 7 * $.SECOND
notif.onshow = ->
setTimeout ->
notif.close()
, 7 * $.SECOND
unless Conf['Persistent QR'] or QR.cooldown.auto
QR.close()