Only filter asynchronously if option remote is true.
We need to update the results right away when we do bulk assignment.
This commit is contained in:
parent
116f5f26ea
commit
5d7445198f
1 changed files with 11 additions and 11 deletions
|
@ -37,20 +37,20 @@ class GitLabDropdownFilter
|
||||||
if keyCode is 13
|
if keyCode is 13
|
||||||
return false
|
return false
|
||||||
|
|
||||||
clearTimeout timeout
|
# Only filter asynchronously only if option remote is set
|
||||||
timeout = setTimeout =>
|
if @options.remote
|
||||||
blur_field = @shouldBlur keyCode
|
clearTimeout timeout
|
||||||
search_text = @input.val()
|
timeout = setTimeout =>
|
||||||
|
blur_field = @shouldBlur keyCode
|
||||||
|
|
||||||
if blur_field and @filterInputBlur
|
if blur_field and @filterInputBlur
|
||||||
@input.blur()
|
@input.blur()
|
||||||
|
|
||||||
if @options.remote
|
@options.query @input.val(), (data) =>
|
||||||
@options.query search_text, (data) =>
|
|
||||||
@options.callback(data)
|
@options.callback(data)
|
||||||
else
|
, 250
|
||||||
@filter search_text
|
else
|
||||||
, 250
|
@filter @input.val()
|
||||||
|
|
||||||
shouldBlur: (keyCode) ->
|
shouldBlur: (keyCode) ->
|
||||||
return BLUR_KEYCODES.indexOf(keyCode) >= 0
|
return BLUR_KEYCODES.indexOf(keyCode) >= 0
|
||||||
|
|
Loading…
Reference in a new issue