This commit is contained in:
parent
1415567a70
commit
ef136731d4
12
select2.js
12
select2.js
@ -2174,9 +2174,9 @@ the specific language governing permissions and limitations under the Apache Lic
|
|||||||
this.selection.data("select2-data", data);
|
this.selection.data("select2-data", data);
|
||||||
|
|
||||||
container.empty();
|
container.empty();
|
||||||
formatted=this.opts.formatSelection(data, container);
|
formatted=this.opts.formatSelection(data, container, this.opts.escapeMarkup);
|
||||||
if (formatted !== undefined) {
|
if (formatted !== undefined) {
|
||||||
container.append(this.opts.escapeMarkup(formatted));
|
container.append(formatted);
|
||||||
}
|
}
|
||||||
cssClass=this.opts.formatSelectionCssClass(data, container);
|
cssClass=this.opts.formatSelectionCssClass(data, container);
|
||||||
if (cssClass !== undefined) {
|
if (cssClass !== undefined) {
|
||||||
@ -2722,9 +2722,9 @@ the specific language governing permissions and limitations under the Apache Lic
|
|||||||
formatted,
|
formatted,
|
||||||
cssClass;
|
cssClass;
|
||||||
|
|
||||||
formatted=this.opts.formatSelection(data, choice.find("div"));
|
formatted=this.opts.formatSelection(data, choice.find("div"), this.opts.escapeMarkup);
|
||||||
if (formatted != undefined) {
|
if (formatted != undefined) {
|
||||||
choice.find("div").replaceWith("<div>"+this.opts.escapeMarkup(formatted)+"</div>");
|
choice.find("div").replaceWith("<div>"+formatted+"</div>");
|
||||||
}
|
}
|
||||||
cssClass=this.opts.formatSelectionCssClass(data, choice.find("div"));
|
cssClass=this.opts.formatSelectionCssClass(data, choice.find("div"));
|
||||||
if (cssClass != undefined) {
|
if (cssClass != undefined) {
|
||||||
@ -3085,8 +3085,8 @@ the specific language governing permissions and limitations under the Apache Lic
|
|||||||
markMatch(result.text, query.term, markup, escapeMarkup);
|
markMatch(result.text, query.term, markup, escapeMarkup);
|
||||||
return markup.join("");
|
return markup.join("");
|
||||||
},
|
},
|
||||||
formatSelection: function (data, container) {
|
formatSelection: function (data, container, escapeMarkup) {
|
||||||
return data ? data.text : undefined;
|
return data ? escapeMarkup(data.text) : undefined;
|
||||||
},
|
},
|
||||||
sortResults: function (results, container, query) {
|
sortResults: function (results, container, query) {
|
||||||
return results;
|
return results;
|
||||||
|
Loading…
Reference in New Issue
Block a user