From d3293175021c03e21e11599bad5faa47c0a67b15 Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Fri, 19 Jul 2013 15:29:06 -0400 Subject: [PATCH] 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) --- zephyr/static/third/bootstrap/js/bootstrap.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/zephyr/static/third/bootstrap/js/bootstrap.js b/zephyr/static/third/bootstrap/js/bootstrap.js index 6ecfe94e1f..3a5fbb7565 100644 --- a/zephyr/static/third/bootstrap/js/bootstrap.js +++ b/zephyr/static/third/bootstrap/js/bootstrap.js @@ -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