Browse Source

fix shift translate

Maxim Sokhatsky 11 years ago
parent
commit
7dbed93200
2 changed files with 3 additions and 5 deletions
  1. 2 4
      apps/web/priv/static/app/js/chat.js
  2. 1 1
      apps/web/priv/static/app/js/roster.js

+ 2 - 4
apps/web/priv/static/app/js/chat.js

@@ -164,7 +164,7 @@ function addOnlineUser(name,full_name,insertMode) {
         var firstElement = listElement.firstElementChild;
         if (null == firstElement) listElement.appendChild(element); else {
             var first = firstElement.firstElementChild.getAttribute("xmlns:data");
-            shiftTranslate(first,0);
+            shiftTranslate(first,1);
             listElement.insertBefore(element,firstElement);
         }
     } else listElement.appendChild(element);
@@ -186,9 +186,7 @@ function shiftTranslate(name,shiftValue) {
     return rect.parentNode.parentNode;
 }
 
-function removeOnlineUser(name) {
-    shiftTranslate(name,-2).remove();
-}
+function removeOnlineUser(name) { shiftTranslate(name,-2).remove(); }
 
 function openChat(evt) {
     document.getElementById("Online-List").style.display = 'none';

+ 1 - 1
apps/web/priv/static/app/js/roster.js

@@ -48,7 +48,7 @@ function RosterHandlers(scope) {
                 id = item.value[0][0].value,
                 names = item.value[0][1].value,
                 surnames = item.value[0][2].value;
-            addOnlineUser(id,names+" "+surnames,'appendChild');
+            addOnlineUser(id,names+" "+surnames+" "+user_count++,'appendChild');
         }
     });