1
0
mirror of synced 2025-02-21 14:33:15 +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=$(document.createElement("div"));
label.addClass("select2-result-label"); 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) { if (formatted!==undefined) {
label.html(formatted); label.html(formatted);
} }
@ -1521,6 +1521,7 @@ the specific language governing permissions and limitations under the Apache Lic
focus: function () { focus: function () {
this.close(); this.close();
this.selection.focus(); this.selection.focus();
this.opts.element.triggerHandler("focus");
}, },
// single // single
@ -2132,6 +2133,7 @@ the specific language governing permissions and limitations under the Apache Lic
focus: function () { focus: function () {
this.close(); this.close();
this.search.focus(); this.search.focus();
this.opts.element.triggerHandler("focus");
}, },
// multi // multi
@ -2527,9 +2529,9 @@ the specific language governing permissions and limitations under the Apache Lic
dropdownCss: {}, dropdownCss: {},
containerCssClass: "", containerCssClass: "",
dropdownCssClass: "", dropdownCssClass: "",
formatResult: function(result, container, query) { formatResult: function(result, container, query, escapeMarkup) {
var markup=[]; var markup=[];
markMatch(result.text, query.term, markup, this.escapeMarkup); markMatch(result.text, query.term, markup, escapeMarkup);
return markup.join(""); return markup.join("");
}, },
formatSelection: function (data, container) { formatSelection: function (data, container) {