瀏覽代碼

Adds blue badges to contact list and chat.

j8
yanas 8 年之前
父節點
當前提交
2919a60403
共有 6 個文件被更改,包括 51 次插入16 次删除
  1. 0
    5
      css/_chat.scss
  2. 36
    8
      css/_toolbars.scss
  3. 3
    0
      css/_variables.scss
  4. 6
    2
      index.html
  5. 3
    0
      modules/UI/side_pannels/chat/Chat.js
  6. 3
    1
      modules/UI/side_pannels/contactlist/ContactList.js

+ 0
- 5
css/_chat.scss 查看文件

@@ -104,11 +104,6 @@
104 104
     color: #a7a7a7;
105 105
 }
106 106
 
107
-#unreadMessages {
108
-    font-size: 8px;
109
-    position: absolute;
110
-}
111
-
112 107
 #chat_container .username {
113 108
     float: left;
114 109
     padding-left: 5px;

+ 36
- 8
css/_toolbars.scss 查看文件

@@ -83,14 +83,6 @@
83 83
     display: none;
84 84
 }
85 85
 
86
-#numberOfParticipants {
87
-  position: absolute;
88
-  top: 5px;
89
-  line-height: 13px;
90
-  font-weight: bold;
91
-  font-size: 11px;
92
-}
93
-
94 86
 #mainToolbar a.button:last-child::after {
95 87
     content: none;
96 88
 }
@@ -149,6 +141,42 @@ a.button>#avatar {
149 141
     margin-top: auto;
150 142
 }
151 143
 
144
+/**
145
+ * Round badge.
146
+ */
147
+.badge-round {
148
+    background-color: $toolbarBadgeBackground;
149
+    color: $toolbarBadgeColor;
150
+    font-size: 9px;
151
+    line-height: 13px;
152
+    font-weight: 700;
153
+    text-align: center;
154
+    border-radius: 50%;
155
+    min-width: 13px;
156
+    overflow: hidden;
157
+    text-overflow: ellipsis;
158
+    box-sizing: border-box;
159
+    vertical-align: middle;
160
+}
161
+
162
+/**
163
+ * Badge-round element text span.
164
+ */
165
+.badge-round>span {
166
+    display: inline-block;
167
+    line-height: 11px;
168
+    padding: 0 0 2px 0;
169
+}
170
+
171
+/**
172
+ * Toolbar specific round badge.
173
+ */
174
+.toolbar .badge-round {
175
+    position: absolute;
176
+    right: 8px;
177
+    bottom: 8px;
178
+}
179
+
152 180
 /**
153 181
  * START of slide in animation for extended toolbar.
154 182
  */

+ 3
- 0
css/_variables.scss 查看文件

@@ -29,6 +29,9 @@ $tooltipBg: rgba(0,0,0, 0.7);
29 29
 $toolbarSelectBackground: rgba(0, 0, 0, .6);
30 30
 $toolbarButtonToggled: #44A5FF;
31 31
 
32
+$toolbarBadgeBackground: #165ECC;
33
+$toolbarBadgeColor: #FFFFFF;
34
+
32 35
 // Main controls
33 36
 $inputBackground: rgba(132, 132, 132, .5);
34 37
 $inputSemiBackground: rgba(132, 132, 132, .8);

+ 6
- 2
index.html 查看文件

@@ -121,11 +121,15 @@
121 121
                 </ul>
122 122
             </span>
123 123
             <a class="button icon-contactList" id="toolbar_contact_list" shortcut="contactlistpopover">
124
-                <span id="numberOfParticipants"></span>
124
+                <span class="badge-round">
125
+                    <span id="numberOfParticipants"></span>
126
+                </span>
125 127
             </a>
126 128
             <!--a class="button icon-link" id="toolbar_button_link"></a-->
127 129
             <a class="button icon-chat" id="toolbar_button_chat" shortcut="toggleChatPopover">
128
-                <span id="unreadMessages"></span>
130
+                <span class="badge-round">
131
+                    <span id="unreadMessages"></span>
132
+                </span>
129 133
             </a>
130 134
             <a class="button" id="toolbar_button_record" style="display: none"></a>
131 135
             <a class="button icon-security" id="toolbar_button_security"></a>

+ 3
- 0
modules/UI/side_pannels/chat/Chat.js 查看文件

@@ -45,6 +45,8 @@ function updateVisualNotification() {
45 45
     else {
46 46
         unreadMsgElement.innerHTML = '';
47 47
     }
48
+
49
+    $(unreadMsgElement).parent()[unreadMessages > 0 ? 'show' : 'hide']();
48 50
 }
49 51
 
50 52
 
@@ -196,6 +198,7 @@ var Chat = {
196 198
             });
197 199
 
198 200
         addSmileys();
201
+        updateVisualNotification();
199 202
     },
200 203
 
201 204
     /**

+ 3
- 1
modules/UI/side_pannels/contactlist/ContactList.js 查看文件

@@ -21,7 +21,9 @@ function updateNumberOfParticipants(delta) {
21 21
     }
22 22
 
23 23
     let buttonIndicatorText = (numberOfContacts === 1) ? '' : numberOfContacts;
24
-    $("#numberOfParticipants").text(buttonIndicatorText);
24
+    $("#numberOfParticipants")
25
+        .text(buttonIndicatorText)
26
+        .parent()[numberOfContacts > 1 ? 'show' : 'hide']();
25 27
 
26 28
     $("#contacts_container>div.title").text(
27 29
         APP.translation.translateString(

Loading…
取消
儲存