From 9faf9c3d6ff1335c4adf7d413324ae22134ef991 Mon Sep 17 00:00:00 2001 From: JC Brand Date: Fri, 21 Apr 2017 19:37:11 +0200 Subject: [PATCH] Don't rerender the text input when filtering contacts --- docs/CHANGES.md | 1 + src/converse-rosterview.js | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/CHANGES.md b/docs/CHANGES.md index a53d852ce..ae4ff8a61 100755 --- a/docs/CHANGES.md +++ b/docs/CHANGES.md @@ -9,6 +9,7 @@ - sinon 2.1.0 - eslint 3.19.0 +- Don't rerender the text input when filtering contacts. [jcbrand] - Show the MUC server in a bookmarked room's info view (in the bookmarks list). [jcbrand] - Enable creation of `dist/converse-muc-embedded.js` build file for the embedded MUC room demo. [jcbrand] diff --git a/src/converse-rosterview.js b/src/converse-rosterview.js index 1f079ef59..9a98ca515 100644 --- a/src/converse-rosterview.js +++ b/src/converse-rosterview.js @@ -145,7 +145,7 @@ initialize: function () { this.model.on('change:filter_type', this.render, this); - this.model.on('change:filter_text', this.render, this); + this.model.on('change:filter_text', this.renderClearButton, this); }, render: function () { @@ -169,6 +169,9 @@ renderClearButton: function () { var roster_filter = this.el.querySelector('.roster-filter'); + if (_.isNull(roster_filter)) { + return; + } roster_filter.classList[this.tog(roster_filter.value)]('x'); },