2 <script src="[% interface %]/lib/select2/js/select2.min.js"></script>
3 [% Asset.css("lib/select2/css/select2.min.css") %]
4 [% Asset.css("css/select2.css") %]
6 jQuery.extend($.fn.select2.defaults, {
9 var width = this.element.outerWidth();
11 // 18 is the width of .select2-arrow
14 if (this.allowClear) {
15 // 42 is the margin-right of .select2-chosen when allowClear is true
18 // 26 is the margin-right of .select2-chosen when allowClear is false
25 // Internationalization
26 formatMatches: function (matches) {
28 return _("One result is available, press enter to select it.");
30 return _("%s results are available, use up and down arrow keys to navigate.").format(matches);
32 formatNoMatches: function () {
33 return _("No matches found");
35 formatInputTooShort: function (input, min) {
36 var n = min - input.length;
37 return _("Please enter %n or more characters").format(n);
39 formatInputTooLong: function (input, max) {
40 var n = input.length - max;
41 return _("Please delete %d character(s)").format(n);
43 formatSelectionTooBig: function (limit) {
44 return _("You can only select %s item(s)").format(limit);
46 formatLoadMore: function (pageNumber) {
47 return _("Loading more results…");
49 formatSearching: function () {
50 return _("Searching…");