Browse code

FIX: zoradovanie kontaktov po ich presune medzi skupinami

Cinan Rakosnik authored on 07/04/2013 at 19:02:45
Showing 1 changed files
... ...
@@ -59,15 +59,16 @@ class Xmpp.Collections.ContactsCollection extends Backbone.Collection
59 59
       @add(contact)
60 60
 
61 61
   moveToActiveList: (contact) ->
62
-    @_switchContactBelongingList(@get(contact), @friendsList, @activeList)
62
+    @_switchContactBelongingList(@get(contact), @friendsList, @activeList) && @activeList.reOrder()
63 63
 
64 64
   moveToInactiveList: (contact) ->
65 65
     if contact == 'all'
66 66
       _.each(@activeList.contactViews, (view) =>
67 67
         @_switchContactBelongingList(view.model, @activeList, @friendsList)
68 68
       )
69
+      @friendsList.reOrder()
69 70
     else
70
-      @_switchContactBelongingList(@get(contact), @activeList, @friendsList)
71
+      @_switchContactBelongingList(@get(contact), @activeList, @friendsList) && @friendsList.reOrder()
71 72
 
72 73
   updateStatus: (response) ->
73 74
     @get(response.jid).set(message: response.status.message, status: response.status.status)