get subtitle in chzn template from state

This commit is contained in:
Uwe Steinmann 2024-10-31 18:08:08 +01:00
parent 5fb5cd00bc
commit 63ba189b3f
2 changed files with 6 additions and 2 deletions

View File

@ -4,8 +4,10 @@
* will receive an unescaped string
* (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 = '';
if(state.subtitle)
subtitle = state.subtitle;
if($(state.element).data('subtitle'))
subtitle = $(state.element).data('subtitle')+''; /* make sure it is a string */
var warning = '';

View File

@ -4,8 +4,10 @@
* will receive an unescaped string
* (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 = '';
if(state.subtitle)
subtitle = state.subtitle;
if($(state.element).data('subtitle'))
subtitle = $(state.element).data('subtitle')+''; /* make sure it is a string */
var warning = '';