3 [% Asset.js("lib/select2/js/select2.min.js") | $raw %]
4 [% Asset.css("lib/select2/css/select2.min.css") | $raw %]
5 [% Asset.css("css/select2.css") | $raw %]
7 jQuery.extend($.fn.select2.defaults, {
10 var width = this.element.outerWidth();
12 // 18 is the width of .select2-arrow
15 if (this.allowClear) {
16 // 42 is the margin-right of .select2-chosen when allowClear is true
19 // 26 is the margin-right of .select2-chosen when allowClear is false
26 // Internationalization
27 formatMatches: function (matches) {
29 return _("One result is available, press enter to select it.");
31 return _("%s results are available, use up and down arrow keys to navigate.").format(matches);
33 formatNoMatches: function () {
34 return _("No matches found");
36 formatInputTooShort: function (input, min) {
37 var n = min - input.length;
38 return _("Please enter %n or more characters").format(n);
40 formatInputTooLong: function (input, max) {
41 var n = input.length - max;
42 return _("Please delete %d character(s)").format(n);
44 formatSelectionTooBig: function (limit) {
45 return _("You can only select %s item(s)").format(limit);
47 formatLoadMore: function (pageNumber) {
48 return _("Loading more results…");
50 formatSearching: function () {
51 return _("Searching…");