浏览代码

Small improvements to notifications

Thibaut Courouble 9 年之前
父节点
当前提交
4c2a5565ed

+ 1 - 1
assets/javascripts/templates/notif_tmpl.coffee

@@ -1,5 +1,5 @@
 notif = (title, html) ->
-  html = html.replace /<a/g, '<a class="_notif-link"'
+  html = html.replace /<a /g, '<a class="_notif-link" '
   """<h5 class="_notif-title">#{title}</h5>#{html}<a href="#" class="_notif-close"></a>"""
 
 textNotif = (title, message) ->

+ 1 - 1
assets/javascripts/views/misc/news.coffee

@@ -4,7 +4,7 @@ class app.views.News extends app.views.Notif
   @className += ' _notif-news'
 
   @defautOptions:
-    autoHide: null
+    autoHide: 30000
 
   init: ->
     @unreadNews = @getUnreadNews()

+ 1 - 0
assets/javascripts/views/misc/notif.coffee

@@ -48,6 +48,7 @@ class app.views.Notif extends app.View
     return
 
   onClick: (event) =>
+    return if event.which isnt 1
     if event.target.tagName isnt 'A' or event.target.classList.contains('_notif-close')
       $.stopEvent(event)
       @hide()

+ 3 - 0
assets/javascripts/views/misc/updates.coffee

@@ -3,6 +3,9 @@
 class app.views.Updates extends app.views.Notif
   @className += ' _notif-news'
 
+  @defautOptions:
+    autoHide: 30000
+
   init: ->
     @updatedDocs = @getUpdatedDocs()
     @show() if @updatedDocs.length

+ 5 - 1
assets/stylesheets/components/_notif.scss

@@ -29,13 +29,14 @@
 
 ._notif-info {
   float: right;
-  color: $textColorLight;
+  color: $notifColorLight;
 }
 
 ._notif-link,
 ._notif-link:hover {
   color: inherit;
   text-decoration: underline;
+  cursor: pointer;
 }
 
 ._notif-close {
@@ -114,6 +115,7 @@
 }
 
 ._notif-list {
+  margin: 0;
   padding-left: 1rem;
 }
 
@@ -121,4 +123,6 @@
   color: $textColor;
   background: rgba($tipBackground, .95);
   border: 1px solid $tipBorder;
+
+  ._notif-info { color: $textColorLight; }
 }

+ 1 - 1
assets/stylesheets/global/_variables.scss

@@ -72,7 +72,7 @@ $labelBackground: #f4f4f4;
 
 $notifBackground: rgba(#333, .85);
 $notifColor: #fff;
-$notifColorLight: #bbb;
+$notifColorLight: #ccc;
 
 $tipBackground: #fffdcd;
 $tipBorder: #e7dca9;

+ 1 - 1
assets/stylesheets/global/variables-dark.scss

@@ -72,7 +72,7 @@ $labelBackground: #3c3c3e;
 
 $notifBackground: rgba(#000, .85);
 $notifColor: #fff;
-$notifColorLight: #bbb;
+$notifColorLight: #ccc;
 
 $tipBackground: #3d4449;
 $tipBorder: #566166;