forked from CGM_Public/pretix_original
Fix select2 with allowClear and no placeholder (Z#23203145)
This commit is contained in:
@@ -533,7 +533,7 @@ var form_handlers = function (el) {
|
|||||||
allowClear: !$s.prop("required"),
|
allowClear: !$s.prop("required"),
|
||||||
width: '100%',
|
width: '100%',
|
||||||
language: $("body").attr("data-select2-locale"),
|
language: $("body").attr("data-select2-locale"),
|
||||||
placeholder: $(this).attr("data-placeholder"),
|
placeholder: $(this).attr("data-placeholder") || "",
|
||||||
ajax: {
|
ajax: {
|
||||||
url: $(this).attr('data-select2-url'),
|
url: $(this).attr('data-select2-url'),
|
||||||
data: function (params) {
|
data: function (params) {
|
||||||
@@ -594,7 +594,7 @@ var form_handlers = function (el) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
placeholder: $(this).attr("data-placeholder"),
|
placeholder: $(this).attr("data-placeholder") | "",
|
||||||
templateResult: function (res) {
|
templateResult: function (res) {
|
||||||
if (!res.id) {
|
if (!res.id) {
|
||||||
return res.text;
|
return res.text;
|
||||||
|
|||||||
Reference in New Issue
Block a user