mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-12 00:45:34 +00:00
callbacks for select2 can now handle numeric values for data attributes
This commit is contained in:
parent
f32ac518ea
commit
556ec6de14
|
@ -5,8 +5,12 @@
|
||||||
* (see https://forums.select2.org/t/propperly-escape-option-value-to-prevent-xss/788)
|
* (see https://forums.select2.org/t/propperly-escape-option-value-to-prevent-xss/788)
|
||||||
*/
|
*/
|
||||||
chzn_template_func = function (state) {
|
chzn_template_func = function (state) {
|
||||||
var subtitle = $(state.element).data('subtitle');
|
var subtitle = '';
|
||||||
var warning = $(state.element).data('warning');
|
if($(state.element).data('subtitle'))
|
||||||
|
subtitle = $(state.element).data('subtitle')+''; /* make sure it is a string */
|
||||||
|
var warning = '';
|
||||||
|
if($(state.element).data('warning'))
|
||||||
|
warning = $(state.element).data('warning')+''; /* make sure it is a string */
|
||||||
var html = '<span>'+state.text.replace(/</g, '<')+'';
|
var html = '<span>'+state.text.replace(/</g, '<')+'';
|
||||||
if(subtitle)
|
if(subtitle)
|
||||||
html += '<br /><i>'+subtitle.replace(/</g, '<')+'</i>';
|
html += '<br /><i>'+subtitle.replace(/</g, '<')+'</i>';
|
||||||
|
|
Loading…
Reference in New Issue
Block a user