Improve changelog notif

pull/308/merge
Thibaut Courouble 9 years ago
parent ed0fa5dcc7
commit 41dd8deceb

@ -24,7 +24,7 @@ app.templates.notifInvalidLocation = ->
""" Otherwise things are likely to break. """
app.templates.notifNews = (news) ->
notif 'Changelog', app.templates.newsList(news)
notif 'Changelog', """<div class="_notif-content _notif-news">#{app.templates.newsList(news, years: false)}</div>"""
app.templates.notifShare = ->
textNotif """ Hi there! """,

@ -8,13 +8,13 @@ app.templates.newsPage = ->
For development updates, follow the project on <a href="https://github.com/Thibaut/devdocs">GitHub</a>.
<div class="_news">#{app.templates.newsList app.news}</div> """
app.templates.newsList = (news) ->
app.templates.newsList = (news, options = {}) ->
year = new Date().getUTCFullYear()
result = ''
for value in news
date = new Date(value[0])
if year isnt date.getUTCFullYear()
if options.years isnt false and year isnt date.getUTCFullYear()
year = date.getUTCFullYear()
result += "<h4>#{year}</h4>"
result += newsItem(date, value[1..])

@ -19,7 +19,7 @@
}
._notif-title {
margin: 0 0 .375rem;
margin: 0 0 .5rem;
line-height: 1rem;
font-size: inherit;
}
@ -49,23 +49,42 @@
&:before { @extend %icon, %icon-close-white; }
}
._notif-news {
width: 20rem;
max-height: 85%;
._notif-content {
max-height: calc(50vh - 4.5rem);
margin: 0 -.25rem 0 0;
padding-right: .75rem;
overflow-y: auto;
&::-webkit-scrollbar { -webkit-appearance: none; width: 10px; }
&::-webkit-scrollbar-button { display: none; }
&::-webkit-scrollbar-track { background: $notifBackground; }
&::-webkit-scrollbar-thumb {
min-height: 2rem;
background: $scrollbarColor;
background-clip: padding-box;
border: 3px solid $notifBackground;
border-radius: 5px;
&:active {
background-color: $scrollbarColorHover;
border-width: 2px;
}
}
> ._notif-title {
margin-bottom: .5rem;
text-align: center;
}
}
._notif-news {
> ._news-row {
line-height: 1.125rem;
font-size: .6875rem;
color: $notifColorLight;
margin-bottom: .25rem;
+ ._news-row { margin-top: .75rem; }
+ ._news-row { margin-top: .625rem; }
}
._news-title {

Loading…
Cancel
Save