_notif-close element is now an anchor instead of div

Now closing a notification can be done with keyboard navigation and extensions like Vimium
pull/292/merge
Philip Karpiak 9 years ago committed by Thibaut
parent deb91d872a
commit 097b328e7a

@ -1,6 +1,6 @@
notif = (title, html) ->
html = html.replace /<a/g, '<a class="_notif-link"'
"""<h5 class="_notif-title">#{title}</h5>#{html}<div class="_notif-close"></div>"""
"""<h5 class="_notif-title">#{title}</h5>#{html}<a href="#" class="_notif-close"></a>"""
textNotif = (title, message) ->
notif title, """<p class="_notif-text">#{message}"""

@ -48,7 +48,7 @@ class app.views.Notif extends app.View
return
onClick: (event) =>
unless event.target.tagName is 'A'
if event.target.tagName isnt 'A' or event.target.classList.contains('_notif-close')
$.stopEvent(event)
@hide()
return

Loading…
Cancel
Save