History

Improve "update ready" notification

Thibaut Courouble committed 9 years ago

Commit d852bde1 parent 2e1af2f3 files · +5 −2Browse files

Unified · Split

3 files
  1. assets/javascripts/templates/notif_tmpl.coffee +2 −2
  2. assets/javascripts/views/misc/notif.coffee +1 −0
  3. assets/stylesheets/components/_notif.scss +2 −0
assets/javascripts/templates/notif_tmpl.coffee+2−2
@@ -6,8 +6,8 @@ textNotif = (title, message) -> · 5 unmodified lines
66 notif title, """<p class="_notif-text">#{message}"""
77
88 app.templates.notifUpdateReady = ->
9− textNotif """ DevDocs has been updated. """,
10− """ <a href="#" data-behavior="reboot">Reload the page</a> to use the new version. """
9+ textNotif """<span data-behavior="reboot">DevDocs has been updated.</span>""",
10+ """<span data-behavior="reboot"><a href="#" data-behavior="reboot">Reload the page</a> to use the new version.</span>"""
1111
1212 app.templates.notifError = ->
1313 textNotif """ Oops, an error occured. """,
assets/javascripts/views/misc/notif.coffee+1−0
@@ -51,6 +51,7 @@ class app.views.Notif extends app.View · 50 unmodified lines
5151
5252 onClick: (event) =>
5353 return if event.which isnt 1
54+ return if event.target.hasAttribute('data-behavior')
5455 if event.target.tagName isnt 'A' or event.target.classList.contains('_notif-close')
5556 $.stopEvent(event)
5657 @hide()
assets/stylesheets/components/_notif.scss+2−0
@@ -55,6 +55,8 @@ · 54 unmodified lines
5555 left: .625rem;
5656 @extend %icon, %icon-close-white;
5757 }
58+
59+ &:hover { opacity: 1; }
5860 }
5961
6062 ._notif-content {