From 15d89c09d6c582cafeaf76252eeb0d0bb228af73 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 28 Jul 2020 15:39:20 +0200 Subject: [PATCH] fix layout problems of select2 menu, allow to add icon to each option --- styles/bootstrap/application.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/styles/bootstrap/application.js b/styles/bootstrap/application.js index 8e23f63f9..47d4da737 100644 --- a/styles/bootstrap/application.js +++ b/styles/bootstrap/application.js @@ -11,7 +11,10 @@ chzn_template_func = function (state) { var warning = ''; if($(state.element).data('warning')) warning = $(state.element).data('warning')+''; /* make sure it is a string */ - var html = ''+state.text.replace(/ '; + html += state.text.replace(/'; if(warning) @@ -58,8 +61,8 @@ $(document).ready( function() { $(".chzn-select").select2({ width: '100%', - templateResult: chzn_template_func, - templateSelection: chzn_template_func + templateResult: chzn_template_func//, + //templateSelection: chzn_template_func }); /* change the color and length of the bar graph showing the password @@ -377,8 +380,8 @@ $(document).ready( function() { element.html(data); $(".chzn-select").select2({ width: '100%', - templateResult: chzn_template_func, - templateSelection: chzn_template_func + templateResult: chzn_template_func//, + //templateSelection: chzn_template_func }); $(".pwd").passStrength({ /* {{{ */ url: "../op/op.Ajax.php", @@ -426,8 +429,8 @@ $(document).ready( function() { element.html(data); $(".chzn-select").select2({ width: '100%', - templateResult: chzn_template_func, - templateSelection: chzn_template_func + templateResult: chzn_template_func//, + //templateSelection: chzn_template_func }); $(".pwd").passStrength({ /* {{{ */ url: "../op/op.Ajax.php",