[fix #2969] use JS replace semicolon by comma in the list email

This commit is contained in:
pedong 2018-11-29 17:03:32 +01:00
parent 826448d7cc
commit c14f9900d6
3 changed files with 8 additions and 2 deletions

View file

@ -3,3 +3,7 @@ import { toggle } from '@utils';
export function toggleCondidentielExplanation() {
toggle(document.querySelector('.confidentiel-explanation'));
}
export function replaceSemicolonByComma(event) {
event.target.value = event.target.value.replace(/;/g, ',');
}

View file

@ -25,6 +25,7 @@ import { toggleCondidentielExplanation } from '../new_design/avis';
import { scrollMessagerie } from '../new_design/messagerie';
import { showMotivation, motivationCancel } from '../new_design/state-button';
import { toggleChart } from '../new_design/toggle-chart';
import { replaceSemicolonByComma } from '../new_design/avis';
// This is the global application namespace where we expose helpers used from rails views
const DS = {
@ -32,7 +33,8 @@ const DS = {
scrollMessagerie,
showMotivation,
motivationCancel,
toggleChart
toggleChart,
replaceSemicolonByComma
};
// Start Rails helpers

View file

@ -3,7 +3,7 @@
%p.avis-notice Les invités pourront consulter, donner un avis sur le dossier et contribuer au fil de messagerie, mais ils ne pourront pas le modifier.
= form_for avis, url: url, html: { class: 'form' } do |f|
= f.email_field :emails, placeholder: 'Adresses email, séparées par des virgules', required: true, multiple: true
= f.email_field :emails, placeholder: 'Adresses email, séparées par des virgules', required: true, multiple: true, onchange: "javascript:DS.replaceSemicolonByComma(event);"
= f.text_area :introduction, rows: 3, value: avis.introduction || 'Bonjour, merci de me donner votre avis sur ce dossier.', required: true
.flex.justify-between.align-baseline
- if must_be_confidentiel