Merge pull request #2658 from alphagov/sticky-footer-edit

Use sticky footer on edit template page
This commit is contained in:
Chris Hill-Scott
2019-01-16 11:26:53 +00:00
committed by GitHub
5 changed files with 26 additions and 12 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

@@ -35,3 +35,9 @@
{% endif %}
</div>
{% endmacro %}
{% macro sticky_page_footer(button_text=None) %}
<div class="js-stick-at-bottom-when-scrolling">
{{ page_footer(button_text) }}
</div>
{% endmacro %}

View File

@@ -1,6 +1,6 @@
{% extends "withnav_template.html" %}
{% from "components/textbox.html" import textbox %}
{% from "components/page-footer.html" import page_footer %}
{% from "components/page-footer.html" import sticky_page_footer %}
{% from "components/radios.html" import radios %}
{% from "components/form.html" import form_wrapper %}
@@ -23,7 +23,7 @@
{% if current_user.platform_admin %}
{{ radios(form.process_type) }}
{% endif %}
{{ page_footer(
{{ sticky_page_footer(
'Save'
) }}
</div>

View File

@@ -1,6 +1,6 @@
{% extends "withnav_template.html" %}
{% from "components/textbox.html" import textbox %}
{% from "components/page-footer.html" import page_footer %}
{% from "components/page-footer.html" import sticky_page_footer %}
{% from "components/radios.html" import radios %}
{% from "components/form.html" import form_wrapper %}
@@ -23,7 +23,7 @@
{% 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(
{{ sticky_page_footer(
'Save'
) }}
</div>

View File

@@ -1,6 +1,6 @@
{% extends "withnav_template.html" %}
{% from "components/textbox.html" import textbox %}
{% from "components/page-footer.html" import page_footer %}
{% from "components/page-footer.html" import sticky_page_footer %}
{% from "components/radios.html" import radios %}
{% from "components/form.html" import form_wrapper %}
@@ -24,7 +24,7 @@
{% if current_user.platform_admin %}
{{ radios(form.process_type) }}
{% endif %}
{{ page_footer(
{{ sticky_page_footer(
'Save'
) }}
</div>