History

Improve changelog notif

Thibaut Courouble committed 10 years ago

Commit 41dd8de1 parent ed0fa5d3 files · +27 −8Browse files

Unified · Split

3 files
  1. assets/javascripts/templates/notif_tmpl.coffee +1 −1
  2. assets/javascripts/templates/pages/news_tmpl.coffee.erb +2 −2
  3. assets/stylesheets/components/_notif.scss +24 −5
assets/javascripts/templates/notif_tmpl.coffee+1−1
@@ -24,7 +24,7 @@ app.templates.notifInvalidLocation = -> · 23 unmodified lines
2424 """ Otherwise things are likely to break. """
2525
2626 app.templates.notifNews = (news) ->
27− notif 'Changelog', app.templates.newsList(news)
27+ notif 'Changelog', """<div class="_notif-content _notif-news">#{app.templates.newsList(news, years: false)}</div>"""
2828
2929 app.templates.notifShare = ->
3030 textNotif """ Hi there! """,
assets/javascripts/templates/pages/news_tmpl.coffee.erb+2−2
@@ -8,13 +8,13 @@ app.templates.newsPage = -> · 7 unmodified lines
88 For development updates, follow the project on <a href="https://github.com/Thibaut/devdocs">GitHub</a>.
99 <div class="_news">#{app.templates.newsList app.news}</div> """
1010
11−app.templates.newsList = (news) ->
11+app.templates.newsList = (news, options = {}) ->
1212 year = new Date().getUTCFullYear()
1313 result = ''
1414
1515 for value in news
1616 date = new Date(value[0])
17− if year isnt date.getUTCFullYear()
17+ if options.years isnt false and year isnt date.getUTCFullYear()
1818 year = date.getUTCFullYear()
1919 result += "<h4>#{year}</h4>"
2020 result += newsItem(date, value[1..])
assets/stylesheets/components/_notif.scss+24−5
@@ -19,7 +19,7 @@ · 18 unmodified lines
1919 }
2020
2121 ._notif-title {
22− margin: 0 0 .375rem;
22+ margin: 0 0 .5rem;
2323 line-height: 1rem;
2424 font-size: inherit;
2525 }
@@ -49,23 +49,42 @@ · 23 unmodified lines
4949 &:before { @extend %icon, %icon-close-white; }
5050 }
5151
52−._notif-news {
53− width: 20rem;
54− max-height: 85%;
52+._notif-content {
53+ max-height: calc(50vh - 4.5rem);
54+ margin: 0 -.25rem 0 0;
55+ padding-right: .75rem;
5556 overflow-y: auto;
5657
58+ &::-webkit-scrollbar { -webkit-appearance: none; width: 10px; }
59+ &::-webkit-scrollbar-button { display: none; }
60+ &::-webkit-scrollbar-track { background: $notifBackground; }
61+ &::-webkit-scrollbar-thumb {
62+ min-height: 2rem;
63+ background: $scrollbarColor;
64+ background-clip: padding-box;
65+ border: 3px solid $notifBackground;
66+ border-radius: 5px;
67+
68+ &:active {
69+ background-color: $scrollbarColorHover;
70+ border-width: 2px;
71+ }
72+ }
73+
5774 > ._notif-title {
5875 margin-bottom: .5rem;
5976 text-align: center;
6077 }
78+}
6179
80+._notif-news {
6281 > ._news-row {
6382 line-height: 1.125rem;
6483 font-size: .6875rem;
6584 color: $notifColorLight;
6685 margin-bottom: .25rem;
6786
68− + ._news-row { margin-top: .75rem; }
87+ + ._news-row { margin-top: .625rem; }
6988 }
7089
7190 ._news-title {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t