Lines 5-31
Link Here
|
5 |
[% Asset.css("css/select2.css") | $raw %] |
5 |
[% Asset.css("css/select2.css") | $raw %] |
6 |
<!-- select2.inc --> |
6 |
<!-- select2.inc --> |
7 |
<script> |
7 |
<script> |
8 |
jQuery.extend($.fn.select2.defaults, { |
8 |
$.fn.select2.defaults.set("allowClear", true); |
9 |
allowClear: true, |
9 |
$.fn.select2.defaults.set("placeholder", ""); |
10 |
width: function() { |
|
|
11 |
var width = this.element.outerWidth(); |
12 |
|
10 |
|
13 |
// 18 is the width of .select2-arrow |
11 |
// Internationalization |
14 |
width -= 18; |
12 |
$.fn.select2.defaults.set("language", { |
15 |
|
|
|
16 |
if (this.allowClear) { |
17 |
// 42 is the margin-right of .select2-chosen when allowClear is true |
18 |
width += 42; |
19 |
} else { |
20 |
// 26 is the margin-right of .select2-chosen when allowClear is false |
21 |
width += 26; |
22 |
} |
23 |
|
24 |
return width; |
25 |
}, |
26 |
|
27 |
// Internationalization |
28 |
language: { |
29 |
errorLoading:function(){return"The results could not be loaded."}, |
13 |
errorLoading:function(){return"The results could not be loaded."}, |
30 |
inputTooLong:function(e){ |
14 |
inputTooLong:function(e){ |
31 |
var n = e.input.length - e.max; |
15 |
var n = e.input.length - e.max; |
Lines 46-52
Link Here
|
46 |
searching:function(){return _("Searching…")}, |
30 |
searching:function(){return _("Searching…")}, |
47 |
removeAllItems:function(){return _("Remove all items")}, |
31 |
removeAllItems:function(){return _("Remove all items")}, |
48 |
removeItem:function(){return _("Remove item")} |
32 |
removeItem:function(){return _("Remove item")} |
49 |
} |
33 |
}); |
50 |
}); |
|
|
51 |
</script> |
34 |
</script> |
52 |
<!-- / select2.inc --> |
35 |
<!-- / select2.inc --> |
53 |
- |
|
|