Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions js/bootstrap-combobox.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,14 @@
var that = this
this.focused = false
var val = this.$element.val()
if (!this.selected && val !== '' ) {
this.$element.val('')
this.$source.val('').trigger('change')
this.$target.val('').trigger('change')
if (!!this.options.force_match) {
if ( !this.selected && val !== '' ) {
this.$element.val('')
this.$source.val('').trigger('change')
this.$target.val('').trigger('change')
}
} else {
this.$target.val(val).trigger('change')
}
if (!this.mousedover && this.shown) setTimeout(function () { that.hide() }, 200)
}
Expand Down Expand Up @@ -231,6 +235,7 @@
template: '<div class="combobox-container"><input type="hidden" /><input type="text" autocomplete="off" /><span class="add-on btn dropdown-toggle" data-dropdown="dropdown"><span class="caret"/><span class="combobox-clear"><i class="icon-remove"/></span></span></div>'
, menu: '<ul class="typeahead typeahead-long dropdown-menu"></ul>'
, item: '<li><a href="#"></a></li>'
, force_match: true
}

$.fn.combobox.Constructor = Combobox
Expand Down