mirror of https://github.com/zulip/zulip.git
typeahead: Simplify call to `this.source`.
`this.source` will always be of type `function`, so we can remove the ternary statement. And `source` always takes one argument, so we can remove the second argument.
This commit is contained in:
parent
954da81f4c
commit
6aee4f270e
|
@ -303,10 +303,7 @@ Typeahead.prototype = {
|
||||||
return this.shown ? this.hide() : this;
|
return this.shown ? this.hide() : this;
|
||||||
}
|
}
|
||||||
|
|
||||||
const items =
|
const items = this.source(this.query);
|
||||||
typeof this.source === "function"
|
|
||||||
? this.source(this.query, this.process.bind(this))
|
|
||||||
: this.source;
|
|
||||||
|
|
||||||
if (!items && this.shown) {
|
if (!items && this.shown) {
|
||||||
this.hide();
|
this.hide();
|
||||||
|
|
Loading…
Reference in New Issue