Added check in Select2 plug-in to avoid multiple components initializations
authorThierry Florac <thierry.florac@onf.fr>
Tue, 03 Apr 2018 11:55:24 +0200
changeset 295 d1965c720cd7
parent 294 ca2b091ad80d
child 296 b2b043bf066a
Added check in Select2 plug-in to avoid multiple components initializations
src/pyams_skin/resources/js/myams.js
--- a/src/pyams_skin/resources/js/myams.js	Wed Mar 28 16:04:18 2018 +0200
+++ b/src/pyams_skin/resources/js/myams.js	Tue Apr 03 11:55:24 2018 +0200
@@ -3442,6 +3442,10 @@
 										selects.each(function() {
 											var select = $(this);
 											var data = select.data();
+											if (data.select2) {
+												// Already initialized
+												return;
+											}
 											var dataOptions = {
 												placeholder: data.amsSelect2Placeholder,
 												multiple: data.amsSelect2Multiple,