Display loading indicator when filtering ref switcher dropdown

This commit is contained in:
Clement Ho 2017-02-10 10:44:42 -06:00
parent 4a9258371b
commit 17f5a34bfd
3 changed files with 9 additions and 3 deletions

View File

@ -47,9 +47,11 @@
}
// Only filter asynchronously only if option remote is set
if (this.options.remote) {
$inputContainer.parent().addClass('is-loading');
clearTimeout(timeout);
return timeout = setTimeout(function() {
return this.options.query(this.input.val(), function(data) {
$inputContainer.parent().removeClass('is-loading');
return this.options.callback(data);
}.bind(this));
}.bind(this), 250);

View File

@ -0,0 +1,4 @@
---
title: Display loading indicator when filtering ref switcher dropdown
merge_request:
author:

View File

@ -20,9 +20,9 @@ feature 'Ref switcher', feature: true, js: true do
input.set 'binary'
wait_for_ajax
input.native.send_keys :down
input.native.send_keys :down
input.native.send_keys :enter
page.within '.dropdown-content ul' do
input.native.send_keys :enter
end
end
expect(page).to have_title 'binary-encoding'