From 0d197bb2ebb4c90880d1777fc89e7d9ed9923e17 Mon Sep 17 00:00:00 2001 From: Pete Matsyburka Date: Fri, 31 Jul 2026 10:57:37 +0300 Subject: [PATCH] fix mobile modal --- app/javascript/elements/open_modal_mobile.js | 1 + app/views/submissions_dashboard/index.html.erb | 2 +- app/views/template_folders/show.html.erb | 2 +- app/views/templates_dashboard/index.html.erb | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/javascript/elements/open_modal_mobile.js b/app/javascript/elements/open_modal_mobile.js index a9d45ed4..4096f1f6 100644 --- a/app/javascript/elements/open_modal_mobile.js +++ b/app/javascript/elements/open_modal_mobile.js @@ -1,5 +1,6 @@ export default class extends HTMLElement { connectedCallback () { + if (this.dataset.disabled === 'true') return if (!this.isMobile()) return if (window.innerWidth >= 768) return diff --git a/app/views/submissions_dashboard/index.html.erb b/app/views/submissions_dashboard/index.html.erb index 5b8a0a71..9bfaf39a 100644 --- a/app/views/submissions_dashboard/index.html.erb +++ b/app/views/submissions_dashboard/index.html.erb @@ -18,7 +18,7 @@ - + <%= link_to new_template_path, class: 'white-button !border gap-2', data: { turbo_frame: :modal } do %> <%= svg_icon('plus', class: 'w-6 h-6 stroke-2') %> diff --git a/app/views/template_folders/show.html.erb b/app/views/template_folders/show.html.erb index d5557117..dd70e3fa 100644 --- a/app/views/template_folders/show.html.erb +++ b/app/views/template_folders/show.html.erb @@ -37,7 +37,7 @@ - + <%= link_to new_template_path(folder_name: @template_folder.full_name), class: 'white-button !border gap-2', data: { turbo_frame: :modal } do %> <%= svg_icon('plus', class: 'w-6 h-6 stroke-2') %> diff --git a/app/views/templates_dashboard/index.html.erb b/app/views/templates_dashboard/index.html.erb index 8ab97431..5406bf68 100644 --- a/app/views/templates_dashboard/index.html.erb +++ b/app/views/templates_dashboard/index.html.erb @@ -30,7 +30,7 @@ - + <%= link_to new_template_path, class: 'white-button !border gap-2', data: { turbo_frame: :modal } do %> <%= svg_icon('plus', class: 'w-6 h-6 stroke-2') %>