diff options
author | blizzz <blizzz@arthur-schiwon.de> | 2017-10-12 15:38:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-12 15:38:23 +0200 |
commit | af4810d5e53626a43349a15aeb34933756377824 (patch) | |
tree | 9bc415cf1c41c59461dbdbeeca15114c5ac22209 /core | |
parent | 423be3df52c734c3a766df1ec19136769eb62da5 (diff) | |
parent | f0d96ed7e1929fdf776b9d3ea55c5aa9434c948d (diff) | |
download | nextcloud-server-af4810d5e53626a43349a15aeb34933756377824.tar.gz nextcloud-server-af4810d5e53626a43349a15aeb34933756377824.zip |
Merge pull request #6795 from nextcloud/fix/contactsmenu-ie11
Fix contacts menu for IE11
Diffstat (limited to 'core')
-rw-r--r-- | core/js/contactsmenu.js | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/core/js/contactsmenu.js b/core/js/contactsmenu.js index 41de10abb47..8d08ea74f4c 100644 --- a/core/js/contactsmenu.js +++ b/core/js/contactsmenu.js @@ -287,6 +287,9 @@ /** @type {undefined|ContactCollection} */ _contacts: undefined, + /** @type {string} */ + _searchTerm: '', + events: { 'input #contactsmenu-search': '_onSearch' }, @@ -294,8 +297,16 @@ /** * @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), /** |