|
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 43-49
Link Here
|
| 43 |
searching:function(){return _("Searching…")}, |
27 |
searching:function(){return _("Searching…")}, |
| 44 |
removeAllItems:function(){return _("Remove all items")}, |
28 |
removeAllItems:function(){return _("Remove all items")}, |
| 45 |
removeItem:function(){return _("Remove item")} |
29 |
removeItem:function(){return _("Remove item")} |
| 46 |
} |
30 |
}); |
| 47 |
}); |
|
|
| 48 |
</script> |
31 |
</script> |
| 49 |
<!-- / select2.inc --> |
32 |
<!-- / select2.inc --> |
| 50 |
- |
|
|