2018-08-09 11:53:59 +02:00
|
|
|
|
import $ from 'jquery';
|
2018-08-22 14:47:56 +02:00
|
|
|
|
import 'select2';
|
2018-08-09 11:53:59 +02:00
|
|
|
|
|
2019-11-04 14:49:53 +01:00
|
|
|
|
const optionTemplate = email =>
|
|
|
|
|
$(
|
|
|
|
|
'<span class="custom-select2-option"><span class="icon person"></span>' +
|
|
|
|
|
email.text +
|
|
|
|
|
'</span>'
|
|
|
|
|
);
|
|
|
|
|
|
2019-08-01 15:22:37 +02:00
|
|
|
|
addEventListener('ds:page:update', () => {
|
2018-07-12 11:50:47 +02:00
|
|
|
|
$('select.select2').select2({
|
|
|
|
|
language: 'fr',
|
|
|
|
|
width: '100%'
|
|
|
|
|
});
|
|
|
|
|
|
2018-09-10 17:52:29 +02:00
|
|
|
|
$('.columns-form select.select2-limited').select2({
|
2018-07-12 11:50:47 +02:00
|
|
|
|
language: 'fr',
|
|
|
|
|
placeholder: 'Sélectionnez des colonnes',
|
|
|
|
|
maximumSelectionLength: '5',
|
|
|
|
|
width: '300px'
|
|
|
|
|
});
|
2018-09-10 17:52:49 +02:00
|
|
|
|
|
|
|
|
|
$('.recipients-form select.select2-limited').select2({
|
|
|
|
|
language: 'fr',
|
|
|
|
|
placeholder: 'Sélectionnez des instructeurs',
|
|
|
|
|
maximumSelectionLength: '30',
|
|
|
|
|
width: '300px'
|
|
|
|
|
});
|
2019-11-04 14:49:53 +01:00
|
|
|
|
|
|
|
|
|
$('select.select2-limited.select-instructeurs').select2({
|
|
|
|
|
language: 'fr',
|
|
|
|
|
dropdownParent: $('.instructeur-wrapper'),
|
|
|
|
|
placeholder: 'Saisir l’adresse email de l’instructeur',
|
|
|
|
|
tags: true,
|
|
|
|
|
tokenSeparators: [',', ' '],
|
|
|
|
|
templateResult: optionTemplate,
|
|
|
|
|
templateSelection: function(email) {
|
|
|
|
|
return $(
|
|
|
|
|
'<span class="custom-select2-option"><span class="icon person"></span>' +
|
|
|
|
|
email.text +
|
|
|
|
|
'</span>'
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
});
|
2018-07-12 11:50:47 +02:00
|
|
|
|
});
|