diff options
author | Daniel Kesselberg <mail@danielkesselberg.de> | 2022-09-15 11:57:23 +0200 |
---|---|---|
committer | Daniel Kesselberg <mail@danielkesselberg.de> | 2022-09-15 12:01:28 +0200 |
commit | 1bfac6d0941894677117144519d14f8f3ed455ec (patch) | |
tree | 92efe0ecb9c687a8763ba96db03ab4c4bb949fea /core | |
parent | e1d9b0bae20510526b0d00c2afe464945847face (diff) | |
download | nextcloud-server-1bfac6d0941894677117144519d14f8f3ed455ec.tar.gz nextcloud-server-1bfac6d0941894677117144519d14f8f3ed455ec.zip |
Improve loading for tags
When opening the tag select and type something the tags are loaded.
If you continue to type but the tags are not finally loaded yet (the first xhr request is still running)
another xhr request is triggered. This happens for every keystroke.
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Diffstat (limited to 'core')
-rw-r--r-- | core/src/systemtags/systemtagscollection.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/core/src/systemtags/systemtagscollection.js b/core/src/systemtags/systemtagscollection.js index 685eb65182a..b123ef30fe4 100644 --- a/core/src/systemtags/systemtagscollection.js +++ b/core/src/systemtags/systemtagscollection.js @@ -69,7 +69,7 @@ fetch: function(options) { var self = this options = options || {} - if (this.fetched || options.force) { + if (this.fetched || this.working || options.force) { // directly call handler if (options.success) { options.success(this, null, options) @@ -79,10 +79,13 @@ return Promise.resolve() } + this.working = true + var success = options.success options = _.extend({}, options) options.success = function() { self.fetched = true + self.working = false if (success) { return success.apply(this, arguments) } |