Permalink
Browse files

Merge pull request #6823 from nextcloud/stable12-fix/contactsmenu-ie11

[stable12] Fix contacts menu for IE11
  • Loading branch information...
rullzer committed Oct 13, 2017
2 parents 7762130 + 0c7d745 commit 21f5f0267f504dd8675cd903d1f449abcac3c9d1
Showing with 13 additions and 2 deletions.
  1. +13 −2 core/js/contactsmenu.js
View
@@ -286,15 +286,26 @@
/** @type {undefined|ContactCollection} */
_contacts: undefined,
/** @type {string} */
_searchTerm: '',
events: {
'input #contactsmenu-search': '_onSearch'
},
/**
* @returns {undefined}
*/
_onSearch: _.debounce(function() {
this.trigger('search', this.$('#contactsmenu-search').val());
_onSearch: _.debounce(function(e) {
var searchTerm = this.$('#contactsmenu-search').val();
// IE11 triggers an 'input' event after the view has been rendered
// resulting in an endless loading loop. To prevent this, we remember
// the last search term to savely ignore some events
// See https://github.com/nextcloud/server/issues/5281
if (searchTerm !== this._searchTerm) {
this.trigger('search', this.$('#contactsmenu-search').val());
this._searchTerm = searchTerm;
}
}, 700),
/**

0 comments on commit 21f5f02

Please sign in to comment.