demarches-normaliennes/app/javascript/new_design/procedure-edit.js
Pierre de La Morinerie 02384b078c procedure: remove UI to edit the european flag
This is an option we want to deprecate, and remove entirely in the
future.

Admins can still add the EU flag manually to their uploaded logo.
2019-10-31 10:27:19 +01:00

18 lines
630 B
JavaScript

import { delegate } from '@utils';
function syncInputToElement(fromSelector, toSelector) {
const fromElement = document.querySelector(fromSelector);
const toElement = document.querySelector(toSelector);
if (toElement && fromElement) {
toElement.innerText = fromElement.value;
}
}
function syncFormToPreview() {
syncInputToElement('#procedure_libelle', 'h2.procedure-title');
syncInputToElement('#procedure_description', '.procedure-description-body');
}
delegate('input', '#procedure-edit #procedure_libelle', syncFormToPreview);
delegate('input', '#procedure-edit #procedure_description', syncFormToPreview);