From 43ae91ad3b127a8d2b46191aca6694e500baa174 Mon Sep 17 00:00:00 2001 From: Felix Hamann Date: Sat, 30 Jun 2018 21:47:19 +0200 Subject: [PATCH 1/4] added styling for fieldsets --- templates/widgets/form.lucius | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/templates/widgets/form.lucius b/templates/widgets/form.lucius index f4d336fdf..d7ea14684 100644 --- a/templates/widgets/form.lucius +++ b/templates/widgets/form.lucius @@ -1,3 +1,13 @@ .hidden { display: none; } + + +fieldset { + border: 0; + margin: 20px 0 30px; + + legend { + display: none; + } +} From 0b7725949995ffac340d0e4195a059dfb8075e3f Mon Sep 17 00:00:00 2001 From: Felix Hamann Date: Sat, 30 Jun 2018 21:54:41 +0200 Subject: [PATCH 2/4] fix line-break for now missing empty fieldsets --- templates/widgets/form.lucius | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/templates/widgets/form.lucius b/templates/widgets/form.lucius index d7ea14684..094758416 100644 --- a/templates/widgets/form.lucius +++ b/templates/widgets/form.lucius @@ -1,5 +1,7 @@ .hidden { - display: none; + visibility: hidden; + height: 0; + opacity: 0; } From eb7f971d10660c097bed8e1788acd480246e5c53 Mon Sep 17 00:00:00 2001 From: Felix Hamann Date: Sat, 30 Jun 2018 22:23:29 +0200 Subject: [PATCH 3/4] fix for async modals --- templates/default-layout.lucius | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/default-layout.lucius b/templates/default-layout.lucius index 251cdc9ba..b78d81b29 100644 --- a/templates/default-layout.lucius +++ b/templates/default-layout.lucius @@ -159,7 +159,6 @@ h4 { .main__content { position: relative; background-color: white; - z-index: 0; overflow: hidden; > .container { From 62b708438cb7cc62aa54d5d2271f482e5f587dbd Mon Sep 17 00:00:00 2001 From: Felix Hamann Date: Sat, 30 Jun 2018 23:05:34 +0200 Subject: [PATCH 4/4] JS respects formnorequired --- templates/standalone/alerts.lucius | 1 + templates/widgets/form.julius | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/templates/standalone/alerts.lucius b/templates/standalone/alerts.lucius index 8856a9b61..4d080cc8d 100644 --- a/templates/standalone/alerts.lucius +++ b/templates/standalone/alerts.lucius @@ -13,6 +13,7 @@ .alerts { top: 150px; + bottom: auto; } } diff --git a/templates/widgets/form.julius b/templates/widgets/form.julius index 2c6100e7d..b36ea327b 100644 --- a/templates/widgets/form.julius +++ b/templates/widgets/form.julius @@ -10,6 +10,12 @@ if (requireds.length == 0) { return false; } + if (typeof button.dataset.formnorequired !== 'undefined' && button.dataset.formnorequired !== null) { + button.addEventListener('click', function() { + form.submit(); + }); + return false; + } updateButtonState(); requireds.forEach(function(el) { @@ -66,10 +72,10 @@ document.addEventListener('DOMContentLoaded', function() { var forms = document.querySelectorAll('form'); Array.from(forms).forEach(function(form) { // auto reactiveButton submit-buttons with required fields - var submitBtn = form.querySelector('[type=submit]'); - if (submitBtn) { + var submitBtns = Array.from(form.querySelectorAll('[type=submit]')); + submitBtns.forEach(function(submitBtn) { window.utils.reactiveButton(form, submitBtn, validateForm); - } + }); // auto conditonal fieldsets var fieldSets = Array.from(form.querySelectorAll('fieldset[data-conditional-id][data-conditional-value]'));