History

Small improvements to notifications

Thibaut Courouble committed 10 years ago

Commit 4c2a5561 parent 7aab65b7 files · +13 −5Browse files

Unified · Split

7 files
  1. assets/javascripts/templates/notif_tmpl.coffee +1 −1
  2. assets/javascripts/views/misc/news.coffee +1 −1
  3. assets/javascripts/views/misc/notif.coffee +1 −0
  4. assets/javascripts/views/misc/updates.coffee +3 −0
  5. assets/stylesheets/components/_notif.scss +5 −1
  6. assets/stylesheets/global/_variables.scss +1 −1
  7. assets/stylesheets/global/variables-dark.scss +1 −1
assets/javascripts/templates/notif_tmpl.coffee+1−1
@@ -1,5 +1,5 @@
11 notif = (title, html) ->
2− html = html.replace /<a/g, '<a class="_notif-link"'
2+ html = html.replace /<a /g, '<a class="_notif-link" '
33 """<h5 class="_notif-title">#{title}</h5>#{html}<a href="#" class="_notif-close"></a>"""
44
55 textNotif = (title, message) ->
assets/javascripts/views/misc/news.coffee+1−1
@@ -4,7 +4,7 @@ class app.views.News extends app.views.Notif · 3 unmodified lines
44 @className += ' _notif-news'
55
66 @defautOptions:
7− autoHide: null
7+ autoHide: 30000
88
99 init: ->
1010 @unreadNews = @getUnreadNews()
assets/javascripts/views/misc/notif.coffee+1−0
@@ -48,6 +48,7 @@ class app.views.Notif extends app.View · 47 unmodified lines
4848 return
4949
5050 onClick: (event) =>
51+ return if event.which isnt 1
5152 if event.target.tagName isnt 'A' or event.target.classList.contains('_notif-close')
5253 $.stopEvent(event)
5354 @hide()
assets/javascripts/views/misc/updates.coffee+3−0
@@ -3,6 +3,9 @@ · 2 unmodified lines
33 class app.views.Updates extends app.views.Notif
44 @className += ' _notif-news'
55
6+ @defautOptions:
7+ autoHide: 30000
8+
69 init: ->
710 @updatedDocs = @getUpdatedDocs()
811 @show() if @updatedDocs.length
assets/stylesheets/components/_notif.scss+5−1
@@ -29,13 +29,14 @@ · 28 unmodified lines
2929
3030 ._notif-info {
3131 float: right;
32− color: $textColorLight;
32+ color: $notifColorLight;
3333 }
3434
3535 ._notif-link,
3636 ._notif-link:hover {
3737 color: inherit;
3838 text-decoration: underline;
39+ cursor: pointer;
3940 }
4041
4142 ._notif-close {
@@ -114,6 +115,7 @@ · 72 unmodified lines
114115 }
115116
116117 ._notif-list {
118+ margin: 0;
117119 padding-left: 1rem;
118120 }
119121
@@ -121,4 +123,6 @@ · 1 unmodified line
121123 color: $textColor;
122124 background: rgba($tipBackground, .95);
123125 border: 1px solid $tipBorder;
126+
127+ ._notif-info { color: $textColorLight; }
124128 }
assets/stylesheets/global/_variables.scss+1−1
@@ -72,7 +72,7 @@ $labelBackground: #f4f4f4; · 71 unmodified lines
7272
7373 $notifBackground: rgba(#333, .85);
7474 $notifColor: #fff;
75−$notifColorLight: #bbb;
75+$notifColorLight: #ccc;
7676
7777 $tipBackground: #fffdcd;
7878 $tipBorder: #e7dca9;
assets/stylesheets/global/variables-dark.scss+1−1
@@ -72,7 +72,7 @@ $labelBackground: #3c3c3e; · 71 unmodified lines
7272
7373 $notifBackground: rgba(#000, .85);
7474 $notifColor: #fff;
75−$notifColorLight: #bbb;
75+$notifColorLight: #ccc;
7676
7777 $tipBackground: #3d4449;
7878 $tipBorder: #566166;