1
0
mirror of synced 2025-02-16 20:13:16 +03:00

pass escape markup into formatResult

This commit is contained in:
Igor Vaynberg 2013-02-05 17:25:32 -08:00
parent e78dc69a6b
commit b55efddf07

View File

@ -698,7 +698,7 @@ the specific language governing permissions and limitations under the Apache Lic
label=$(document.createElement("div"));
label.addClass("select2-result-label");
formatted=opts.escapeMarkup(opts.formatResult(result, label, query));
formatted=opts.formatResult(result, label, query, self.opts.escapeMarkup);
if (formatted!==undefined) {
label.html(formatted);
}
@ -1521,6 +1521,7 @@ the specific language governing permissions and limitations under the Apache Lic
focus: function () {
this.close();
this.selection.focus();
this.opts.element.triggerHandler("focus");
},
// single
@ -2132,6 +2133,7 @@ the specific language governing permissions and limitations under the Apache Lic
focus: function () {
this.close();
this.search.focus();
this.opts.element.triggerHandler("focus");
},
// multi
@ -2527,9 +2529,9 @@ the specific language governing permissions and limitations under the Apache Lic
dropdownCss: {},
containerCssClass: "",
dropdownCssClass: "",
formatResult: function(result, container, query) {
formatResult: function(result, container, query, escapeMarkup) {
var markup=[];
markMatch(result.text, query.term, markup, this.escapeMarkup);
markMatch(result.text, query.term, markup, escapeMarkup);
return markup.join("");
},
formatSelection: function (data, container) {