Changes when loading indicator is added to dropdown
Previously it was added when you started typing. But there is actually a delay before sending any requests which meant the loading icon was visible but it wasn't actually loading anything
This commit is contained in:
parent
dc303fe2db
commit
8cbf27af2b
1 changed files with 2 additions and 1 deletions
|
@ -47,9 +47,10 @@
|
|||
}
|
||||
// Only filter asynchronously only if option remote is set
|
||||
if (this.options.remote) {
|
||||
$inputContainer.parent().addClass('is-loading');
|
||||
clearTimeout(timeout);
|
||||
return timeout = setTimeout(function() {
|
||||
$inputContainer.parent().addClass('is-loading');
|
||||
|
||||
return this.options.query(this.input.val(), function(data) {
|
||||
$inputContainer.parent().removeClass('is-loading');
|
||||
return this.options.callback(data);
|
||||
|
|
Loading…
Reference in a new issue