2019-10-21 17:18:05 +02:00
|
|
|
import { delegate } from '@utils';
|
2019-09-24 16:38:58 +02:00
|
|
|
|
|
|
|
function syncInputToElement(fromSelector, toSelector) {
|
|
|
|
const fromElement = document.querySelector(fromSelector);
|
|
|
|
const toElement = document.querySelector(toSelector);
|
|
|
|
if (toElement && fromElement) {
|
|
|
|
toElement.innerText = fromElement.value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function syncFormToPreview() {
|
2019-10-21 18:12:57 +02:00
|
|
|
syncInputToElement('#procedure_libelle', '.procedure-title');
|
2019-09-24 16:38:58 +02:00
|
|
|
syncInputToElement('#procedure_description', '.procedure-description-body');
|
|
|
|
}
|
|
|
|
|
2019-10-21 18:12:57 +02:00
|
|
|
delegate('input', '.procedure-form #procedure_libelle', syncFormToPreview);
|
|
|
|
delegate('input', '.procedure-form #procedure_description', syncFormToPreview);
|