mirror of
https://github.com/freeCodeCamp/devdocs
synced 2024-11-16 19:48:10 +01:00
Improve "update ready" notification
This commit is contained in:
parent
2e1af2f8a0
commit
d852bde5f3
3 changed files with 5 additions and 2 deletions
|
@ -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. """,
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -55,6 +55,8 @@
|
|||
left: .625rem;
|
||||
@extend %icon, %icon-close-white;
|
||||
}
|
||||
|
||||
&:hover { opacity: 1; }
|
||||
}
|
||||
|
||||
._notif-content {
|
||||
|
|
Loading…
Reference in a new issue