diff --git a/app/javascript/application.js b/app/javascript/application.js index 1674bdc4..5b03bb9e 100644 --- a/app/javascript/application.js +++ b/app/javascript/application.js @@ -14,6 +14,12 @@ document.addEventListener('turbo:before-cache', () => { window.flash?.remove() }) +document.addEventListener('keyup', (e) => { + if (e.code === 'Escape') { + document.activeElement?.blur() + } +}) + window.customElements.define('toggle-visible', ToggleVisible) window.customElements.define('disable-hidden', DisableHidden) window.customElements.define('turbo-modal', TurboModal) @@ -29,6 +35,8 @@ window.customElements.define('template-builder', class extends HTMLElement { template: reactive(JSON.parse(this.dataset.template)) }) + this.app.config.globalProperties.$t = (key) => TemplateBuilder.i18n[key] || key + this.app.mount(this.appElem) this.appendChild(this.appElem) diff --git a/app/javascript/submission_form/form.vue b/app/javascript/submission_form/form.vue index 9e91c2ed..a3585094 100644 --- a/app/javascript/submission_form/form.vue +++ b/app/javascript/submission_form/form.vue @@ -130,7 +130,7 @@ @attached="attachments.push($event)" />
- {{ field?.name || field?.type }} + + +
+
diff --git a/app/javascript/template_builder/fields.vue b/app/javascript/template_builder/fields.vue index 9eb25214..9345eac8 100644 --- a/app/javascript/template_builder/fields.vue +++ b/app/javascript/template_builder/fields.vue @@ -1,5 +1,5 @@