From dba50cd1bfbae066987c5da62426b06df820ddd5 Mon Sep 17 00:00:00 2001 From: Pete Matsyburka Date: Thu, 30 Jul 2026 19:10:48 +0300 Subject: [PATCH] mobile fixes --- app/javascript/application.js | 16 ++++++++++++++ app/javascript/template_builder/builder.vue | 4 ++++ .../_editor_toolbar.html.erb | 17 ++++++++------- app/views/shared/_classes.html.erb | 2 +- app/views/shared/_navbar.html.erb | 2 +- app/views/shared/_settings_nav.html.erb | 6 +++--- app/views/shared/_turbo_modal_large.html.erb | 2 +- .../submissions/_send_email_base.html.erb | 4 ++-- app/views/templates/_template.html.erb | 4 ++-- app/views/templates/_title.html.erb | 4 ++-- app/views/templates/show.html.erb | 20 +++++++++++------- config/locales/i18n.yml | 21 ++++++++++++------- 12 files changed, 67 insertions(+), 35 deletions(-) diff --git a/app/javascript/application.js b/app/javascript/application.js index 9e14ff9b..6e8eec57 100644 --- a/app/javascript/application.js +++ b/app/javascript/application.js @@ -160,6 +160,7 @@ safeRegisterElement('history-back', HistoryBack) safeRegisterElement('template-builder', class extends HTMLElement { connectedCallback () { document.addEventListener('turbo:submit-end', this.onSubmit) + document.addEventListener('turbo:before-cache', this.onBeforeCache) this.appElem = document.createElement('div') @@ -243,8 +244,14 @@ safeRegisterElement('template-builder', class extends HTMLElement { } } + onBeforeCache = () => { + this.app?.unmount() + this.appElem?.remove() + } + disconnectedCallback () { document.removeEventListener('turbo:submit-end', this.onSubmit) + document.removeEventListener('turbo:before-cache', this.onBeforeCache) this.app?.unmount() this.appElem?.remove() @@ -253,6 +260,8 @@ safeRegisterElement('template-builder', class extends HTMLElement { safeRegisterElement('import-list', class extends HTMLElement { connectedCallback () { + document.addEventListener('turbo:before-cache', this.onBeforeCache) + this.appElem = document.createElement('div') this.app = createApp(ImportList, { @@ -267,7 +276,14 @@ safeRegisterElement('import-list', class extends HTMLElement { this.appendChild(this.appElem) } + onBeforeCache = () => { + this.app?.unmount() + this.appElem?.remove() + } + disconnectedCallback () { + document.removeEventListener('turbo:before-cache', this.onBeforeCache) + this.app?.unmount() this.appElem?.remove() } diff --git a/app/javascript/template_builder/builder.vue b/app/javascript/template_builder/builder.vue index 8dd2208f..fca220ac 100644 --- a/app/javascript/template_builder/builder.vue +++ b/app/javascript/template_builder/builder.vue @@ -281,6 +281,10 @@ :href="`/templates/${template.id}`" class="base-button" > + diff --git a/app/views/personalization_settings/_editor_toolbar.html.erb b/app/views/personalization_settings/_editor_toolbar.html.erb index d6c58698..4e6c4185 100644 --- a/app/views/personalization_settings/_editor_toolbar.html.erb +++ b/app/views/personalization_settings/_editor_toolbar.html.erb @@ -1,21 +1,21 @@
-
+
-
+
-
+
-
+
@@ -23,12 +23,12 @@
-
+
-
+
@@ -37,8 +37,9 @@ <% if local_assigns[:variables]&.any? %> <% variable_labels = { 'account.name' => t('variables.account_name'), 'submitter.link' => t('variables.submitter_link'), 'template.name' => t('variables.template_name'), 'submission.submitters' => t('variables.submission_submitters'), 'submission.link' => t('variables.submission_link'), 'documents.link' => t('variables.documents_link') } %>