1
0
Эх сурвалжийг харах

Improve "update ready" notification

Thibaut Courouble 8 жил өмнө
parent
commit
d852bde5f3

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

@@ -6,8 +6,8 @@ textNotif = (title, message) ->
   notif title, """<p class="_notif-text">#{message}"""
 
 app.templates.notifUpdateReady = ->
-  textNotif """ DevDocs has been updated. """,
-            """ <a href="#" data-behavior="reboot">Reload the page</a> to use the new version. """
+  textNotif """<span data-behavior="reboot">DevDocs has been updated.</span>""",
+            """<span data-behavior="reboot"><a href="#" data-behavior="reboot">Reload the page</a> to use the new version.</span>"""
 
 app.templates.notifError = ->
   textNotif """ Oops, an error occured. """,

+ 1 - 0
assets/javascripts/views/misc/notif.coffee

@@ -51,6 +51,7 @@ class app.views.Notif extends app.View
 
   onClick: (event) =>
     return if event.which isnt 1
+    return if event.target.hasAttribute('data-behavior')
     if event.target.tagName isnt 'A' or event.target.classList.contains('_notif-close')
       $.stopEvent(event)
       @hide()

+ 2 - 0
assets/stylesheets/components/_notif.scss

@@ -55,6 +55,8 @@
     left: .625rem;
     @extend %icon, %icon-close-white;
   }
+
+  &:hover { opacity: 1; }
 }
 
 ._notif-content {