From f6828a24ad3b02fedd4eae50297d13d63d036735 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sun, 26 Jun 2022 15:01:27 +0200 Subject: [PATCH] Adjust form queries so selector doesn't pick delete button --- app/javascript/retrospring/features/settings/index.ts | 2 +- app/views/settings/theme/edit.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/javascript/retrospring/features/settings/index.ts b/app/javascript/retrospring/features/settings/index.ts index ab96781c..39024af8 100644 --- a/app/javascript/retrospring/features/settings/index.ts +++ b/app/javascript/retrospring/features/settings/index.ts @@ -10,7 +10,7 @@ export default (): void => { themeDocumentHandler(); registerEvents([ - { type: 'submit', target: document.querySelector('[action="/settings/theme"]'), handler: themeSubmitHandler }, + { type: 'submit', target: document.querySelector('form.edit_theme, form.new_theme'), handler: themeSubmitHandler }, { type: 'submit', target: document.querySelector('#edit_user'), handler: userSubmitHandler }, { type: 'change', target: document.querySelector('#user_profile_picture[type=file]'), handler: profilePictureChangeHandler }, { type: 'change', target: document.querySelector('#user_profile_header[type=file]'), handler: profileHeaderChangeHandler }, diff --git a/app/views/settings/theme/edit.haml b/app/views/settings/theme/edit.haml index d536dd4d..81f85882 100644 --- a/app/views/settings/theme/edit.haml +++ b/app/views/settings/theme/edit.haml @@ -7,7 +7,7 @@ - if current_user.theme .pull-right = button_to t(".delete"), settings_theme_path, data: { confirm: t("voc.confirm") }, tabindex: -1, method: :delete, class: "btn btn-danger" -= bootstrap_form_for(current_user.theme || Theme.new, url: { action: "update" }, html: { id: "update" }, method: :patch) do |f| += bootstrap_form_for(current_user.theme || Theme.new, html: { id: "update" }, method: :patch) do |f| .card .card-body %h2= t(".general.heading")