From efc40a88c0c428fc0921c17c96ee6251185db7d1 Mon Sep 17 00:00:00 2001 From: Jeff Zamanski Date: Wed, 27 Nov 2013 23:44:36 -0500 Subject: [PATCH] Add 'combobox-selected' class before triggering change events. Allows change event handler to call combobox('toggle') to clear the combobox. --- js/bootstrap-combobox.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/js/bootstrap-combobox.js b/js/bootstrap-combobox.js index 207a8fd..62667fe 100755 --- a/js/bootstrap-combobox.js +++ b/js/bootstrap-combobox.js @@ -97,11 +97,14 @@ , select: function () { var val = this.$menu.find('.active').attr('data-value'); - this.$element.val(this.updater(val)).trigger('change'); - this.$target.val(this.map[val]).trigger('change'); - this.$source.val(this.map[val]).trigger('change'); + this.$element.val(this.updater(val)); + this.$target.val(this.map[val]); + this.$source.val(this.map[val]); this.$container.addClass('combobox-selected'); this.selected = true; + this.$element.trigger('change'); + this.$target.trigger('change'); + this.$source.trigger('change'); return this.hide(); }