Browse Source

_notif-close element is now an anchor instead of div

Now closing a notification can be done with keyboard navigation and extensions like Vimium
Philip Karpiak 10 years ago
parent
commit
097b328e7a

+ 1 - 1
assets/javascripts/templates/notif_tmpl.coffee

@@ -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}"""

+ 1 - 1
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