From 097b328e7a0e8a29fcb17c27a4de93a23f10dcfd Mon Sep 17 00:00:00 2001 From: Philip Karpiak Date: Mon, 16 Nov 2015 09:29:00 -0500 Subject: [PATCH] _notif-close element is now an anchor instead of div Now closing a notification can be done with keyboard navigation and extensions like Vimium --- assets/javascripts/templates/notif_tmpl.coffee | 2 +- assets/javascripts/views/misc/notif.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/javascripts/templates/notif_tmpl.coffee b/assets/javascripts/templates/notif_tmpl.coffee index 767947a2..b1a584d3 100644 --- a/assets/javascripts/templates/notif_tmpl.coffee +++ b/assets/javascripts/templates/notif_tmpl.coffee @@ -1,6 +1,6 @@ notif = (title, html) -> html = html.replace /#{title}#{html}
""" + """
#{title}
#{html}
""" textNotif = (title, message) -> notif title, """

#{message}""" diff --git a/assets/javascripts/views/misc/notif.coffee b/assets/javascripts/views/misc/notif.coffee index c6e87ce0..12dea496 100644 --- a/assets/javascripts/views/misc/notif.coffee +++ b/assets/javascripts/views/misc/notif.coffee @@ -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