diff --git a/js/bootstrap-combobox.js b/js/bootstrap-combobox.js index 70725b1..d3f9c37 100755 --- a/js/bootstrap-combobox.js +++ b/js/bootstrap-combobox.js @@ -47,7 +47,7 @@ constructor: Combobox , setup: function () { - var combobox = $(this.template()); + var combobox = typeof(this.template) == "function" ? $(this.template()) : $(this.template) ; this.$source.before(combobox); this.$source.hide(); return combobox; diff --git a/js/tests/unit/bootstrap-combobox.js b/js/tests/unit/bootstrap-combobox.js index f5dcd29..7c73f80 100644 --- a/js/tests/unit/bootstrap-combobox.js +++ b/js/tests/unit/bootstrap-combobox.js @@ -320,4 +320,9 @@ $(function () { combobox.$menu.remove() }) + + test("should return with custom template", function () { + var $select = $('') + ok($($select).combobox({template: '
'})[0] == $select[0], 'select returned') + }) })