Просмотр исходного кода

Introduces chat_container_id variable.

efficient_tiling
damencho 9 лет назад
Родитель
Сommit
a671093489
1 измененных файлов: 9 добавлений и 5 удалений
  1. 9
    5
      modules/UI/side_pannels/chat/Chat.js

+ 9
- 5
modules/UI/side_pannels/chat/Chat.js Просмотреть файл

12
 var notificationInterval = false;
12
 var notificationInterval = false;
13
 var unreadMessages = 0;
13
 var unreadMessages = 0;
14
 
14
 
15
+/**
16
+ * The container id, which is and the element id.
17
+ */
18
+var CHAT_CONTAINER_ID = "chat_container";
15
 
19
 
16
 /**
20
 /**
17
  * Shows/hides a visual notification, indicating that a message has arrived.
21
  * Shows/hides a visual notification, indicating that a message has arrived.
131
  */
135
  */
132
 function resizeChatConversation() {
136
 function resizeChatConversation() {
133
     var msgareaHeight = $('#usermsg').outerHeight();
137
     var msgareaHeight = $('#usermsg').outerHeight();
134
-    var chatspace = $('#chat_container');
138
+    var chatspace = $('#' + CHAT_CONTAINER_ID);
135
     var width = chatspace.width();
139
     var width = chatspace.width();
136
     var chat = $('#chatconversation');
140
     var chat = $('#chatconversation');
137
     var smileys = $('#smileysarea');
141
     var smileys = $('#smileysarea');
187
         };
191
         };
188
         usermsg.autosize({callback: onTextAreaResize});
192
         usermsg.autosize({callback: onTextAreaResize});
189
 
193
 
190
-        $("#chat_container").bind("shown",
194
+        $("#" + CHAT_CONTAINER_ID).bind("shown",
191
             function () {
195
             function () {
192
                 unreadMessages = 0;
196
                 unreadMessages = 0;
193
                 setVisualNotification(false);
197
                 setVisualNotification(false);
275
      * conversation mode or not.
279
      * conversation mode or not.
276
      */
280
      */
277
     setChatConversationMode (isConversationMode) {
281
     setChatConversationMode (isConversationMode) {
278
-        $('#chat_container')
282
+        $('#' + CHAT_CONTAINER_ID)
279
             .toggleClass('is-conversation-mode', isConversationMode);
283
             .toggleClass('is-conversation-mode', isConversationMode);
280
         if (isConversationMode) {
284
         if (isConversationMode) {
281
             $('#usermsg').focus();
285
             $('#usermsg').focus();
286
      * Resizes the chat area.
290
      * Resizes the chat area.
287
      */
291
      */
288
     resizeChat (width, height) {
292
     resizeChat (width, height) {
289
-        $('#chat_container').width(width).height(height);
293
+        $('#' + CHAT_CONTAINER_ID).width(width).height(height);
290
 
294
 
291
         resizeChatConversation();
295
         resizeChatConversation();
292
     },
296
     },
296
      */
300
      */
297
     isVisible () {
301
     isVisible () {
298
         return UIUtil.isVisible(
302
         return UIUtil.isVisible(
299
-            document.getElementById("chat_container"));
303
+            document.getElementById(CHAT_CONTAINER_ID));
300
     },
304
     },
301
     /**
305
     /**
302
      * Shows and hides the window with the smileys
306
      * Shows and hides the window with the smileys

Загрузка…
Отмена
Сохранить