diff --git a/zephyr/static/third/bootstrap/js/bootstrap.js b/zephyr/static/third/bootstrap/js/bootstrap.js index 8a33ae9d8f..94cc26b14e 100644 --- a/zephyr/static/third/bootstrap/js/bootstrap.js +++ b/zephyr/static/third/bootstrap/js/bootstrap.js @@ -1841,6 +1841,19 @@ return this.hide() } + , select_and_continue: function () { + // We don't call updater() because it potentially has side-effects. + // This does mean that smartSpaceBar can't be used in cases where the + // item values are transformed by updater(). It's generally imprudent + // to do transformations in updater(), so this should be a + // non-issue for most users. + var val = this.$menu.find('.active').data('typeahead-value') + this.$element + .val(val + ' ') + .change() + return this.hide() + } + , updater: function (item) { return item } @@ -2027,6 +2040,16 @@ this.select() break + case 32: // space + if (this.options.smartSpaceBar) { + if (!this.shown) return + this.select_and_continue() + } + else { + this.lookup() + } + break + case 27: // escape if (!this.shown) return this.hide()