Adjust form queries so selector doesn't pick delete button

This commit is contained in:
Andreas Nedbal 2022-06-26 15:01:27 +02:00 committed by Karina Kwiatek
parent 2e251474dc
commit f6828a24ad
2 changed files with 2 additions and 2 deletions

View File

@ -10,7 +10,7 @@ export default (): void => {
themeDocumentHandler(); themeDocumentHandler();
registerEvents([ 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: '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_picture[type=file]'), handler: profilePictureChangeHandler },
{ type: 'change', target: document.querySelector('#user_profile_header[type=file]'), handler: profileHeaderChangeHandler }, { type: 'change', target: document.querySelector('#user_profile_header[type=file]'), handler: profileHeaderChangeHandler },

View File

@ -7,7 +7,7 @@
- if current_user.theme - if current_user.theme
.pull-right .pull-right
= button_to t(".delete"), settings_theme_path, data: { confirm: t("voc.confirm") }, tabindex: -1, method: :delete, class: "btn btn-danger" = 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
.card-body .card-body
%h2= t(".general.heading") %h2= t(".general.heading")