From b55efddf07952dc934c4230d69610023d6e191f3 Mon Sep 17 00:00:00 2001 From: Igor Vaynberg Date: Tue, 5 Feb 2013 17:25:32 -0800 Subject: [PATCH] pass escape markup into formatResult --- select2.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/select2.js b/select2.js index b3c326ec..cb21dc9e 100644 --- a/select2.js +++ b/select2.js @@ -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) {