1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-09-25 21:09:06 +02:00
This commit is contained in:
Jacob Thornton
2012-04-16 17:36:03 -07:00
parent ba202d77ba
commit f3cf4cbaae
4 changed files with 13 additions and 9 deletions

View File

@@ -1565,6 +1565,7 @@
this.matcher = this.options.matcher || this.matcher
this.sorter = this.options.sorter || this.sorter
this.highlighter = this.options.highlighter || this.highlighter
this.updater = this.options.updater || this.updater
this.$menu = $(this.options.menu).appendTo('body')
this.source = this.options.source
this.shown = false
@@ -1578,11 +1579,15 @@
, select: function () {
var val = this.$menu.find('.active').attr('data-value')
this.$element
.val(val)
.val(this.updater(val))
.change()
return this.hide()
}
, updater: function (item) {
return item
}
, show: function () {
var pos = $.extend({}, this.$element.offset(), {
height: this.$element[0].offsetHeight