Use sticky footer on edit template page

If you have a long template it’s annoying to have to scroll all the
way to the bottom to click save, when you’ve only changed a small thing
near the staert of the content.
This commit is contained in:
Chris Hill-Scott
2019-01-14 13:30:12 +00:00
parent 0ad4a06534
commit 509a9e861d
4 changed files with 29 additions and 15 deletions

View File

@@ -32,12 +32,20 @@
};
this.resize = () => this.$textbox.height(
Math.max(
this.initialHeight,
this.$background.outerHeight()
)
);
this.resize = () => {
this.$textbox.height(
Math.max(
this.initialHeight,
this.$background.outerHeight()
)
);
if ('stickAtBottomWhenScrolling' in GOVUK) {
GOVUK.stickAtBottomWhenScrolling.recalculate();
}
};
this.escapedMessage = () => $('<div/>').text(this.$textbox.val()).html();

View File

@@ -23,9 +23,11 @@
{% if current_user.platform_admin %}
{{ radios(form.process_type) }}
{% endif %}
{{ page_footer(
'Save'
) }}
<div class="js-stick-at-bottom-when-scrolling">
{{ page_footer(
'Save'
) }}
</div>
</div>
<aside class="column-whole">
{% include "partials/templates/guidance-formatting.html" %}

View File

@@ -23,9 +23,11 @@
{% endif %}
{{ textbox(form.subject, width='1-1', highlight_tags=True, rows=2) }}
{{ textbox(form.template_content, highlight_tags=True, width='1-1', rows=8) }}
{{ page_footer(
'Save'
) }}
<div class="js-stick-at-bottom-when-scrolling">
{{ page_footer(
'Save'
) }}
</div>
</div>
<aside class="column-three-quarters">
{% include "partials/templates/guidance-formatting-letters.html" %}

View File

@@ -24,9 +24,11 @@
{% if current_user.platform_admin %}
{{ radios(form.process_type) }}
{% endif %}
{{ page_footer(
'Save'
) }}
<div class="js-stick-at-bottom-when-scrolling">
{{ page_footer(
'Save'
) }}
</div>
</div>
<aside class="column-whole">
{% include "partials/templates/guidance-personalisation.html" %}