app/assets/javascripts/spree/backend/taxon_autocomplete.js.erb in solidus_backend-1.1.2 vs app/assets/javascripts/spree/backend/taxon_autocomplete.js.erb in solidus_backend-1.1.3
- old
+ new
@@ -1,8 +1,12 @@
'use strict';
var set_taxon_select = function(){
+ function formatTaxon(taxon) {
+ return Select2.util.escapeMarkup(taxon.pretty_name);
+ }
+
if ($('#product_taxon_ids').length > 0) {
$('#product_taxon_ids').select2({
placeholder: Spree.translations.taxon_placeholder,
multiple: true,
initSelection: function (element, callback) {
@@ -35,15 +39,11 @@
results: data['taxons'],
more: more
};
}
},
- formatResult: function (taxon) {
- return taxon.pretty_name;
- },
- formatSelection: function (taxon) {
- return taxon.pretty_name;
- }
+ formatResult: formatTaxon,
+ formatSelection: formatTaxon
});
}
}
$(document).ready(function () {