summaryrefslogtreecommitdiffstats
path: root/sitestatic/bootstrap-typeahead.js
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-09-25 03:21:15 +0200
committerDan McGee <dan@archlinux.org>2012-09-25 03:25:45 +0200
commitf3e23371fa0473c82c28932e85570d94e5fc232a (patch)
tree8c1bb39a773a2f18bee46a70ff223a2a019f3b64 /sitestatic/bootstrap-typeahead.js
parentd69e30cbf2cd76bdf87de138db030209ca43b2e1 (diff)
downloadarchweb-f3e23371fa0473c82c28932e85570d94e5fc232a.tar.gz
archweb-f3e23371fa0473c82c28932e85570d94e5fc232a.tar.xz
Don't auto-select the first item in typeahead
This assumption was baked into the Twitter bootstrap JS; kill it so it is still easy to do a freeform search if wanted. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'sitestatic/bootstrap-typeahead.js')
-rw-r--r--sitestatic/bootstrap-typeahead.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/sitestatic/bootstrap-typeahead.js b/sitestatic/bootstrap-typeahead.js
index c2ccdea..3d355ae 100644
--- a/sitestatic/bootstrap-typeahead.js
+++ b/sitestatic/bootstrap-typeahead.js
@@ -45,9 +45,11 @@
, select: function () {
var val = this.$menu.find('.active').attr('data-value')
- this.$element
- .val(this.updater(val))
- .change()
+ if (val) {
+ this.$element
+ .val(this.updater(val))
+ .change()
+ }
return this.hide()
}
@@ -141,7 +143,6 @@
return i[0]
})
- items.first().addClass('active')
this.$menu.html(items)
return this
}