Support helpOnEmptyStrings option in typeahead.

It allows us to provide suggestions when the user types '' in
a searchbox (e.g. by hitting delete when text is selected).

(imported from commit dc27ef86db2b6ec40039e4e9668b8ccc288c6134)
This commit is contained in:
Steve Howell 2013-07-19 15:29:06 -04:00
parent 72f65070f3
commit d329317502
1 changed files with 4 additions and 2 deletions

View File

@ -1889,8 +1889,10 @@
this.query = this.$element.val()
if (!this.query || this.query.length < this.options.minLength) {
return this.shown ? this.hide() : this
if (!this.options.helpOnEmptyStrings) {
if (!this.query || this.query.length < this.options.minLength) {
return this.shown ? this.hide() : this
}
}
items = $.isFunction(this.source) ? this.source(this.query, $.proxy(this.process, this)) : this.source