Only initialize champs editor if is present on page
This commit is contained in:
parent
00244effdb
commit
d45273e117
1 changed files with 7 additions and 1 deletions
|
@ -10,6 +10,12 @@ Vue.component('DraggableItem', DraggableItem);
|
||||||
|
|
||||||
addEventListener('DOMContentLoaded', () => {
|
addEventListener('DOMContentLoaded', () => {
|
||||||
const el = document.querySelector('#champs-editor');
|
const el = document.querySelector('#champs-editor');
|
||||||
|
if (el) {
|
||||||
|
initEditor(el);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
function initEditor(el) {
|
||||||
const { directUploadsUrl, dragIconUrl } = el.dataset;
|
const { directUploadsUrl, dragIconUrl } = el.dataset;
|
||||||
|
|
||||||
const state = {
|
const state = {
|
||||||
|
@ -48,7 +54,7 @@ addEventListener('DOMContentLoaded', () => {
|
||||||
this.updateAll = updateAll;
|
this.updateAll = updateAll;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
|
|
||||||
function createUpdateFunctions(app, isAnnotation) {
|
function createUpdateFunctions(app, isAnnotation) {
|
||||||
let isSaving = false;
|
let isSaving = false;
|
||||||
|
|
Loading…
Reference in a new issue