Ver código fonte

Changed the following:
- Subscribe event with help of jQuery one instead of delegate, now that
the rosterView is no longer emptied on every render to avoid
registring several handlers of remove action, which meant you had to
click 4 times for the jQuery Dialog to go away
- Remove the element from the rosterView when the remove event is
triggered on the model which removes just that item instead of
emptying the list and appending the remaining models again

ichim-david 12 anos atrás
pai
commit
85e9c7cecc
1 arquivos alterados com 4 adições e 2 exclusões
  1. 4 2
      converse.js

+ 4 - 2
converse.js

@@ -1327,7 +1327,7 @@
             }
             }
 
 
             // Event handlers
             // Event handlers
-            this.$el.delegate('a.remove-xmpp-contact','click', function (ev) {
+            this.$el.find('.remove-xmpp-contact').one('click', function (ev) {
                 ev.preventDefault();
                 ev.preventDefault();
                 that.removeContact();
                 that.removeContact();
             });
             });
@@ -1608,8 +1608,10 @@
             }, this);
             }, this);
 
 
             this.model.on("remove", function (item) {
             this.model.on("remove", function (item) {
+                // remove element from the rosterView instance
+                this.rosteritemviews[item.id].$el.remove();
+                
                 delete this.rosteritemviews[item.id];
                 delete this.rosteritemviews[item.id];
-                this.render(item);
             }, this);
             }, this);
 
 
             this.$el.hide();
             this.$el.hide();