1
0
mirror of synced 2025-02-10 17:19:23 +03:00

Added default selection for AJAX

This commit is contained in:
Kevin Brown 2014-11-07 20:20:37 -05:00
parent 5535f072e1
commit d306fcf82c

View File

@ -170,7 +170,9 @@ $(".js-example-data-array-selected").select2({
</p> </p>
<p> <p>
<select class="js-example-data-ajax form-control"></select> <select class="js-example-data-ajax form-control">
<option value="ivaynberg/select2" selected="selected">ivaynberg/select2</option>
</select>
</p> </p>
<pre data-fill-from=".js-code-data-ajax"></pre> <pre data-fill-from=".js-code-data-ajax"></pre>
@ -543,7 +545,7 @@ $.fn.select2.amd.require(
return markup; return markup;
}, },
templateSelection: function (repo) { templateSelection: function (repo) {
return repo.full_name; return repo.full_name || repo.text;
} }
}); });