summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Nagel <info@felixnagel.com>2011-12-28 18:56:41 +0100
committerFelix Nagel <info@felixnagel.com>2011-12-28 18:56:41 +0100
commit98d0dbc6d8cea8d5b994b5110501cacd8e62211a (patch)
tree9054d5d3cb018d3473e8ce16ca4ff372f6412464
parentd80f57b12d9a38e440eb5f797def9fd35592a3c7 (diff)
downloadjquery-ui-98d0dbc6d8cea8d5b994b5110501cacd8e62211a.tar.gz
jquery-ui-98d0dbc6d8cea8d5b994b5110501cacd8e62211a.zip
added: feature for html escaping, see #131
-rw-r--r--ui/jquery.ui.selectmenu.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js
index 2eeaea9b9..9d48582bb 100644
--- a/ui/jquery.ui.selectmenu.js
+++ b/ui/jquery.ui.selectmenu.js
@@ -30,6 +30,7 @@ $.widget("ui.selectmenu", {
maxHeight: null,
icons: null,
format: null,
+ escapeHtml: false,
bgImage: function() {},
wrapperElement: "<div />"
},
@@ -624,9 +625,14 @@ $.widget("ui.selectmenu", {
this.open(event);
}
},
-
+
_formatText: function(text) {
- return (this.options.format ? this.options.format(text) : text);
+ if (this.options.format) {
+ text = this.options.format(text);
+ } else if (this.options.escapeHtml) {
+ text = $('<div />').text(text).html();
+ }
+ return text;
},
_selectedIndex: function() {