Merge pull request #397 from kchung/master
Prevent formatSelection for erroring when accessing an empty select input.
This commit is contained in:
commit
c0ce4be801
@ -926,7 +926,7 @@
|
|||||||
|
|
||||||
if (this.opened()) return false;
|
if (this.opened()) return false;
|
||||||
|
|
||||||
event = jQuery.Event("open");
|
event = $.Event("open");
|
||||||
this.opts.element.trigger(event);
|
this.opts.element.trigger(event);
|
||||||
return !event.isDefaultPrevented();
|
return !event.isDefaultPrevented();
|
||||||
},
|
},
|
||||||
@ -1020,7 +1020,7 @@
|
|||||||
this.results.empty();
|
this.results.empty();
|
||||||
this.clearSearch();
|
this.clearSearch();
|
||||||
|
|
||||||
this.opts.element.trigger(jQuery.Event("close"));
|
this.opts.element.trigger($.Event("close"));
|
||||||
},
|
},
|
||||||
|
|
||||||
// abstract
|
// abstract
|
||||||
@ -2361,7 +2361,7 @@
|
|||||||
return markup.join("");
|
return markup.join("");
|
||||||
},
|
},
|
||||||
formatSelection: function (data, container) {
|
formatSelection: function (data, container) {
|
||||||
return data.text;
|
return data ? data.text : undefined;
|
||||||
},
|
},
|
||||||
formatResultCssClass: function(data) {return undefined;},
|
formatResultCssClass: function(data) {return undefined;},
|
||||||
formatNoMatches: function () { return "No matches found"; },
|
formatNoMatches: function () { return "No matches found"; },
|
||||||
|
Loading…
Reference in New Issue
Block a user