Use a select2 box for looking to instructeurs
This commit is contained in:
parent
9fb72ea8e6
commit
9ca026a630
10 changed files with 136 additions and 35 deletions
|
@ -1,6 +1,13 @@
|
|||
import $ from 'jquery';
|
||||
import 'select2';
|
||||
|
||||
const optionTemplate = email =>
|
||||
$(
|
||||
'<span class="custom-select2-option"><span class="icon person"></span>' +
|
||||
email.text +
|
||||
'</span>'
|
||||
);
|
||||
|
||||
addEventListener('ds:page:update', () => {
|
||||
$('select.select2').select2({
|
||||
language: 'fr',
|
||||
|
@ -20,4 +27,20 @@ addEventListener('ds:page:update', () => {
|
|||
maximumSelectionLength: '30',
|
||||
width: '300px'
|
||||
});
|
||||
|
||||
$('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>'
|
||||
);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue