Merge pull request #3301 from tchak/fix-js-error

Only initialize champs editor if is present on page
This commit is contained in:
Paul Chavard 2019-01-17 16:46:40 +01:00 committed by GitHub
commit 83bba82c76
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,6 +10,12 @@ Vue.component('DraggableItem', DraggableItem);
addEventListener('DOMContentLoaded', () => {
const el = document.querySelector('#champs-editor');
if (el) {
initEditor(el);
}
});
function initEditor(el) {
const { directUploadsUrl, dragIconUrl } = el.dataset;
const state = {
@ -48,7 +54,7 @@ addEventListener('DOMContentLoaded', () => {
this.updateAll = updateAll;
}
});
});
}
function createUpdateFunctions(app, isAnnotation) {
let isSaving = false;