Merge pull request #6823 from nextcloud/stable12-fix/contactsmenu-ie11
[stable12] Fix contacts menu for IE11
This commit is contained in:
commit
21f5f0267f
|
@ -286,6 +286,9 @@
|
|||
/** @type {undefined|ContactCollection} */
|
||||
_contacts: undefined,
|
||||
|
||||
/** @type {string} */
|
||||
_searchTerm: '',
|
||||
|
||||
events: {
|
||||
'input #contactsmenu-search': '_onSearch'
|
||||
},
|
||||
|
@ -293,8 +296,16 @@
|
|||
/**
|
||||
* @returns {undefined}
|
||||
*/
|
||||
_onSearch: _.debounce(function() {
|
||||
_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),
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue