bootstrap-combobox 1.2 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  module Bootstrap
2
2
  module Combobox
3
3
  # This version is a little arbitrary; at time of this writing source fork is at 1.1-WIP?
4
- VERSION = "1.2"
4
+ VERSION = "1.2.1"
5
5
  end
6
6
  end
@@ -1,5 +1,5 @@
1
1
  /* =============================================================
2
- * bootstrap-combobox.js v1.1.3
2
+ * bootstrap-combobox.js v1.2
3
3
  * =============================================================
4
4
  * Copyright 2012 Daniel Farrell
5
5
  *
@@ -202,10 +202,14 @@
202
202
  var that = this
203
203
  this.focused = false
204
204
  var val = this.$element.val()
205
- if (!this.selected && val !== '' ) {
206
- this.$element.val('')
207
- this.$source.val('').trigger('change')
208
- this.$target.val('').trigger('change')
205
+ if (!!this.options.force_match) {
206
+ if ( !this.selected && val !== '' ) {
207
+ this.$element.val('')
208
+ this.$source.val('').trigger('change')
209
+ this.$target.val('').trigger('change')
210
+ }
211
+ } else {
212
+ this.$target.val(val).trigger('change')
209
213
  }
210
214
  if (!this.mousedover && this.shown) setTimeout(function () { that.hide() }, 200)
211
215
  }
@@ -233,6 +237,7 @@
233
237
  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>'
234
238
  , menu: '<ul class="typeahead typeahead-long dropdown-menu"></ul>'
235
239
  , item: '<li><a href="#"></a></li>'
240
+ , force_match: true
236
241
  }
237
242
 
238
243
  $.fn.combobox.Constructor = Combobox
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootstrap-combobox
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.2'
4
+ version: 1.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: