Improve "update ready" notification

This commit is contained in:
Thibaut Courouble 2017-08-06 11:23:02 -04:00
parent 2e1af2f8a0
commit d852bde5f3
3 changed files with 5 additions and 2 deletions

View file

@ -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. """,

View file

@ -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()

View file

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