浏览代码

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
     color: #a7a7a7;
104
     color: #a7a7a7;
105
 }
105
 }
106
 
106
 
107
-#unreadMessages {
108
-    font-size: 8px;
109
-    position: absolute;
110
-}
111
-
112
 #chat_container .username {
107
 #chat_container .username {
113
     float: left;
108
     float: left;
114
     padding-left: 5px;
109
     padding-left: 5px;

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

83
     display: none;
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
 #mainToolbar a.button:last-child::after {
86
 #mainToolbar a.button:last-child::after {
95
     content: none;
87
     content: none;
96
 }
88
 }
149
     margin-top: auto;
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
  * START of slide in animation for extended toolbar.
181
  * START of slide in animation for extended toolbar.
154
  */
182
  */

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

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

+ 6
- 2
index.html 查看文件

121
                 </ul>
121
                 </ul>
122
             </span>
122
             </span>
123
             <a class="button icon-contactList" id="toolbar_contact_list" shortcut="contactlistpopover">
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
             </a>
127
             </a>
126
             <!--a class="button icon-link" id="toolbar_button_link"></a-->
128
             <!--a class="button icon-link" id="toolbar_button_link"></a-->
127
             <a class="button icon-chat" id="toolbar_button_chat" shortcut="toggleChatPopover">
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
             </a>
133
             </a>
130
             <a class="button" id="toolbar_button_record" style="display: none"></a>
134
             <a class="button" id="toolbar_button_record" style="display: none"></a>
131
             <a class="button icon-security" id="toolbar_button_security"></a>
135
             <a class="button icon-security" id="toolbar_button_security"></a>

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

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

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

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

正在加载...
取消
保存