Commit a875ba51 authored by ichim-david's avatar ichim-david

Moved assignment of template for RosterView out of the render method to avoid...

Moved assignment of template for RosterView out of the render method to avoid calling empty and readding items everytime the render method is called
parent 3224a8c5
......@@ -523,7 +523,7 @@
'<a href="{{user_profile_url}}" class="user">' +
'<img src="{{portrait_url}}" alt="Avatar of {{fullname}}" class="avatar" />' +
'<div class="chat-title"> {{ fullname }} </div>' +
'</a>' +
'</a>' +
'<p class="user-custom-message"><p/>' +
'</div>' +
'<div class="chat-content"></div>' +
......@@ -1548,6 +1548,8 @@
delete this.rosteritemviews[item.id];
this.render();
}, this);
this.$el.html(this.template());
},
template: _.template('<dt id="xmpp-contact-requests">Contact requests</dt>' +
......@@ -1555,7 +1557,6 @@
'<dt id="pending-xmpp-contacts">Pending contacts</dt>'),
render: function () {
this.$el.empty().html(this.template());
var models = this.model.sort().models,
children = $(this.el).children(),
$my_contacts = this.$el.find('#xmpp-contacts').hide(),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment