@@ -85,7 +85,7 @@ var textChat = (function () {
85
85
share . toggleRoomBtnHandler ( $joinBtn , "JOIN" ) ;
86
86
}
87
87
88
- function activateModal ( headerId , headTitle , userCount ) {
88
+ function activateModal ( headerId , headTitle , userCount , roomInfo ) {
89
89
if ( ! headerId ) return false ;
90
90
var existTextChat = $ ( document ) . find ( "#wrtc_textChatWrapper" ) ;
91
91
@@ -124,6 +124,9 @@ var textChat = (function () {
124
124
$joinBtn . prop ( 'disabled' , false ) ;
125
125
}
126
126
share . toggleRoomBtnHandler ( $joinBtn , "LEAVE" ) ;
127
+
128
+ var $textChatModalUserList = $ ( document ) . find ( "#wrtc_textChatWrapper #textChatUserModal ul" ) ;
129
+ share . appendUserList ( roomInfo , $textChatModalUserList ) ;
127
130
}
128
131
129
132
function addUserToRoom ( data , roomInfo ) {
@@ -136,9 +139,11 @@ var textChat = (function () {
136
139
$ ( ".textChatToolbar .textChat" ) . text ( userCount ) ;
137
140
138
141
var $textChatUserList = $headingRoom . find ( '.wrtc_content.textChat ul' ) ;
139
-
140
142
share . appendUserList ( roomInfo , $textChatUserList ) ;
141
143
144
+ var $textChatModalUserList = $ ( document ) . find ( "#wrtc_textChatWrapper #textChatUserModal ul" ) ;
145
+ share . appendUserList ( roomInfo , $textChatModalUserList ) ;
146
+
142
147
var user = share . getUserFromId ( data . userId ) ;
143
148
144
149
// notify, a user join the video-chat room
@@ -153,11 +158,21 @@ var textChat = (function () {
153
158
154
159
share . notifyNewUserJoined ( "text" , msg ) ;
155
160
161
+ if ( data . headerId === currentRoom . headerId && data . userId !== clientVars . userId ) {
162
+ $ . gritter . add ( {
163
+ 'text' : '<span class="author-name">' + user . name + '</span>' + 'has joined the text-chat, <b><i> "' + headTitle + '"</b></i>' ,
164
+ 'sticky' : false ,
165
+ 'time' : 3000 ,
166
+ 'position' : 'center' ,
167
+ 'class_name' : 'chat-gritter-msg'
168
+ } ) ;
169
+ }
170
+
156
171
if ( data . userId === clientVars . userId ) {
157
172
currentRoom = data ;
158
173
$headingRoom . attr ( { 'data-text' : true } ) ;
159
174
share . roomBoxIconActive ( ) ;
160
- activateModal ( headerId , headTitle , userCount ) ;
175
+ activateModal ( headerId , headTitle , userCount , roomInfo ) ;
161
176
}
162
177
}
163
178
@@ -171,8 +186,10 @@ var textChat = (function () {
171
186
$ ( ".textChatToolbar .textChat" ) . text ( userCount ) ;
172
187
173
188
var $textChatUserList = $headingRoom . find ( '.wrtc_content.textChat ul' ) ;
189
+ var $textChatModalUserList = $ ( document ) . find ( "#wrtc_textChatWrapper #textChatUserModal ul" ) ;
174
190
175
191
share . appendUserList ( roomInfo , $textChatUserList ) ;
192
+ share . appendUserList ( roomInfo , $textChatModalUserList ) ;
176
193
177
194
if ( userCount === 0 ) {
178
195
$textChatUserList . append ( '<li class="empty">Be the first to join the <button class="btn_joinChat_text" data-action="JOIN" data-id="' + headerId + '" data-join="text"><b>text-chat</b></button></li>' ) ;
0 commit comments