Don't handle a notification's onclose on Firefox.

Mozilla hates devs and won't let us distinguish
an automatic closing to a user's closing action.
This commit is contained in:
Mayhem 2013-08-17 22:54:51 +02:00
parent 5742405f67
commit 25f77a12da

View File

@ -118,11 +118,15 @@ QR =
body: el.textContent body: el.textContent
icon: Favicon.logo icon: Favicon.logo
notif.onclick = -> window.focus() notif.onclick = -> window.focus()
<% if (type === 'crx') { %>
# Firefox automatically closes notifications
# so we can't control the onclose properly.
notif.onclose = -> notice.close() notif.onclose = -> notice.close()
setTimeout -> setTimeout ->
notif.onclose = null notif.onclose = null
notif.close() notif.close()
, 5 * $.SECOND , 5 * $.SECOND
<% } %>
notifications: [] notifications: []
cleanNotifications: -> cleanNotifications: ->
for notification in QR.notifications for notification in QR.notifications