|
@@ -129,7 +129,7 @@
|
|
|
},
|
|
|
});
|
|
|
|
|
|
- _converse.RosterFilterView = Backbone.View.extend({
|
|
|
+ _converse.RosterFilterView = Backbone.VDOMView.extend({
|
|
|
tagName: 'span',
|
|
|
events: {
|
|
|
"keydown .roster-filter": "liveFilter",
|
|
@@ -145,8 +145,8 @@
|
|
|
this.model.on('change:filter_text', this.renderClearButton, this);
|
|
|
},
|
|
|
|
|
|
- render () {
|
|
|
- this.el.innerHTML = tpl_roster_filter(
|
|
|
+ renderHTML () {
|
|
|
+ return tpl_roster_filter(
|
|
|
_.extend(this.model.toJSON(), {
|
|
|
placeholder: __('Filter'),
|
|
|
label_contacts: LABEL_CONTACTS,
|
|
@@ -161,8 +161,10 @@
|
|
|
label_xa: __('Extended Away'),
|
|
|
label_offline: __('Offline')
|
|
|
}));
|
|
|
+ },
|
|
|
+
|
|
|
+ afterRender () {
|
|
|
this.renderClearButton();
|
|
|
- return this.$el;
|
|
|
},
|
|
|
|
|
|
renderClearButton () {
|
|
@@ -231,13 +233,14 @@
|
|
|
},
|
|
|
|
|
|
show () {
|
|
|
- if (this.$el.is(':visible')) { return this; }
|
|
|
- this.$el.show();
|
|
|
+ if (utils.isVisible(this.el)) { return this; }
|
|
|
+ this.el.classList.add('fade-in');
|
|
|
+ this.el.classList.remove('hidden');
|
|
|
return this;
|
|
|
},
|
|
|
|
|
|
hide () {
|
|
|
- if (!this.$el.is(':visible')) { return this; }
|
|
|
+ if (!utils.isVisible(this.el)) { return this; }
|
|
|
if (this.el.querySelector('.roster-filter').value.length > 0) {
|
|
|
// Don't hide if user is currently filtering.
|
|
|
return;
|
|
@@ -246,7 +249,7 @@
|
|
|
'filter_text': '',
|
|
|
'chat_state': ''
|
|
|
});
|
|
|
- this.$el.hide();
|
|
|
+ this.el.classList.add('hidden');
|
|
|
return this;
|
|
|
},
|
|
|
|
|
@@ -279,7 +282,9 @@
|
|
|
|
|
|
render () {
|
|
|
this.renderRoster();
|
|
|
- this.$el.html(this.filter_view.render());
|
|
|
+ this.el.innerHTML = "";
|
|
|
+ this.el.appendChild(this.filter_view.render().el);
|
|
|
+
|
|
|
if (!_converse.allow_contact_requests) {
|
|
|
// XXX: if we ever support live editing of config then
|
|
|
// we'll need to be able to remove this class on the fly.
|
|
@@ -327,7 +332,7 @@
|
|
|
}, _converse.animate ? 100 : 0),
|
|
|
|
|
|
showHideFilter () {
|
|
|
- if (!this.$el.is(':visible')) {
|
|
|
+ if (!utils.isVisible(this.el)) {
|
|
|
return;
|
|
|
}
|
|
|
if (_converse.roster.length >= 10) {
|