mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
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>
This commit is contained in:
parent
e1d9b0bae2
commit
1bfac6d094
1 changed files with 4 additions and 1 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue