From a1c9c65f2307472c745a4a9f3298cff0c4746b3b Mon Sep 17 00:00:00 2001 From: shatran Date: Tue, 9 Sep 2014 19:13:25 +0300 Subject: [PATCH] assign (this.options.template || this.template) to this.template before this.setup() is called in the constructor. that way when this.setup() is called, this.template() is the correct template - the default one or the customised one. --- js/bootstrap-combobox.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/bootstrap-combobox.js b/js/bootstrap-combobox.js index af5dc0d..1639986 100755 --- a/js/bootstrap-combobox.js +++ b/js/bootstrap-combobox.js @@ -25,13 +25,13 @@ var Combobox = function ( element, options ) { this.options = $.extend({}, $.fn.combobox.defaults, options); + this.template = this.options.template || this.template this.$source = $(element); this.$container = this.setup(); this.$element = this.$container.find('input[type=text]'); this.$target = this.$container.find('input[type=hidden]'); this.$button = this.$container.find('.dropdown-toggle'); this.$menu = $(this.options.menu).appendTo('body'); - this.template = this.options.template || this.template this.matcher = this.options.matcher || this.matcher; this.sorter = this.options.sorter || this.sorter; this.highlighter = this.options.highlighter || this.highlighter;