Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

USH-4329: Make anchored submit button sticky #34490

Merged
merged 12 commits into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,6 @@ hqDefine("cloudcare/js/form_entry/form_ui", [
self.hasSubmitAttempted = ko.observable(false);
self.isSubmitting = ko.observable(false);
self.isAnchoredSubmitStyle = toggles.toggleEnabled('WEB_APPS_ANCHORED_SUBMIT');
self.submitClass = constants.FULL_WIDTH + ' text-center' +
(self.isAnchoredSubmitStyle ? ' anchored-submit' : ' nonanchored-submit');

self.currentIndex = ko.observable("0");
self.atLastIndex = ko.observable(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,20 +163,19 @@ <h1 class="title" data-bind="text: title, visible: !showInFormNavigation()"></h1
</div>
</div>
{% endif %}
<div id="submit-button" class="form-actions form-group noprint-sub-container" data-bind="visible: showSubmitButton">
<div data-bind="
css: submitClass,
style: {
'bottom':isAnchoredSubmitStyle && {{ request.couch_user.can_edit_data|yesno:'true,false' }} {% if environment != "web-apps" %} && false {% endif %} ? '30px' : '' {# data preview bar #}
}">
<div id="submit-button" class="form-actions form-group noprint-sub-container"
data-bind="visible: showSubmitButton,
css: { 'sticky-submit': isAnchoredSubmitStyle },
style: {
'bottom':isAnchoredSubmitStyle && {{ request.couch_user.can_edit_data|yesno:'true,false' }} {% if environment != "web-apps" %} && false {% endif %} ? '30px' : '0' {# data preview bar #}
Jtang-1 marked this conversation as resolved.
Show resolved Hide resolved
}"
>
<div class="col-12 text-center submit">
<button class="submit btn btn-primary"
type="submit"
data-bind="
enable: enableSubmitButton,
css: {
'btn-lg': !isAnchoredSubmitStyle,
'btn-sm': isAnchoredSubmitStyle,
}">
">
<i class="fa fa-spin fa-refresh"
data-bind="visible: !enableSubmitButton(){% if environment == "web-apps" %} && erroredQuestions.length != 0{% endif %}"
></i>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,18 @@
margin-right: -@form-text-indent;
}

background-color: lighten(@cc-brand-hi, 10);
background-color: @call-to-action-extra-hi;
.border-bottom-radius(0);

.nonanchored-submit .btn {
.submit .btn {
font-size: 20px;
padding: 13px 24px;
.transition(all .5s);
}
}

.anchored-submit {
background-color: @call-to-action-low;
width: 100vw;
padding-top: 5px;
padding-bottom: 5px;
position: fixed;
bottom: 0px;
left: 0;
z-index: @zindex-formplayer-anchored-submit;
MartinRiese marked this conversation as resolved.
Show resolved Hide resolved
.sticky-submit {
position: sticky;
}

// Bootstrap introduces -10px left/right margin for row classes. This causes element to overflow parent.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,18 @@
margin-right: -@form-text-indent;
}

background-color: lighten(@cc-brand-hi, 10);
background-color: @primary-subtle;
MartinRiese marked this conversation as resolved.
Show resolved Hide resolved
.border-bottom-radius(0);

.nonanchored-submit .btn {
.submit .btn {
font-size: 20px;
padding: 13px 24px;
.transition(all .5s);
}
}

.anchored-submit {
background-color: @call-to-action-low;
width: 100vw;
padding-top: 5px;
padding-bottom: 5px;
position: fixed;
bottom: 0px;
left: 0;
z-index: @zindex-formplayer-anchored-submit;
.sticky-submit {
position: sticky;
}

// Bootstrap introduces -10px left/right margin for row classes. This causes element to overflow parent.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@
@zindex-formplayer-progress: 990;
@zindex-cloudcare-debugger: 1005;
@zindex-formplayer-scroll-to-bottom: 5;
@zindex-formplayer-anchored-submit: 2;


@input-border-radius-large: 5px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,5 @@ $zindex-persistent-tile-cloudcare: 993;
$zindex-formplayer-progress: 990;
$zindex-cloudcare-debugger: 1005;
$zindex-formplayer-scroll-to-bottom: 5;
$zindex-formplayer-anchored-submit: 2;

$cursor-disabled: 'not-allowed';
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
+++
@@ -28,7 +28,7 @@
margin-right: -@form-text-indent;
}

- background-color: @call-to-action-extra-hi;
+ background-color: @primary-subtle;
.border-bottom-radius(0);

.submit .btn {
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
+++
@@ -1,124 +1,225 @@
@@ -1,123 +1,225 @@
-@import "@{b3-import-variables}";
-
-// Nunito Sans is used on dimagi.com and embedded in hqwebapp/base.html
Expand Down Expand Up @@ -198,7 +198,6 @@
-@zindex-formplayer-progress: 990;
-@zindex-cloudcare-debugger: 1005;
-@zindex-formplayer-scroll-to-bottom: 5;
-@zindex-formplayer-anchored-submit: 2;
-
-
-@input-border-radius-large: 5px;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
+++
@@ -1,124 +1,69 @@
@@ -1,123 +1,68 @@
-@import "@{b3-import-variables}";
+/*
+These are Boostrap 3 variables that were carried over in the
Expand Down Expand Up @@ -159,7 +159,6 @@
-@zindex-formplayer-progress: 990;
-@zindex-cloudcare-debugger: 1005;
-@zindex-formplayer-scroll-to-bottom: 5;
-@zindex-formplayer-anchored-submit: 2;
+$zindex-navbar: 1000;
+$zindex-report-loading: 100;
+$zindex-app-preview: 998;
Expand All @@ -168,7 +167,6 @@
+$zindex-formplayer-progress: 990;
+$zindex-cloudcare-debugger: 1005;
+$zindex-formplayer-scroll-to-bottom: 5;
+$zindex-formplayer-anchored-submit: 2;

-
-@input-border-radius-large: 5px;
Expand Down
Loading