mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-07 06:38:24 -04:00
Prevent scrolling of branding previews
In user research we quite often saw people accidentally scroll the branding preview `<iframe>` when trying to scroll the page. This is suboptimal because they: - were confused why the page wasn’t scrolling - lost visibility of the branding they were trying to preview because it scrolled outside the bounds of the `<iframe>`
This commit is contained in:
@@ -13,7 +13,7 @@
|
|||||||
const $paneWrapper = $('<div class="govuk-grid-column-full"></div>');
|
const $paneWrapper = $('<div class="govuk-grid-column-full"></div>');
|
||||||
const $form = $('form');
|
const $form = $('form');
|
||||||
const previewType = $form.data('previewType');
|
const previewType = $form.data('previewType');
|
||||||
const $previewPane = $(`<iframe src="/_${previewType}?${buildQueryString(['branding_style', branding_style])}" class="branding-preview"></iframe>`);
|
const $previewPane = $(`<iframe src="/_${previewType}?${buildQueryString(['branding_style', branding_style])}" class="branding-preview" scrolling="no"></iframe>`);
|
||||||
|
|
||||||
function buildQueryString () {
|
function buildQueryString () {
|
||||||
return $.map(arguments, (val, idx) => encodeURI(val[0]) + '=' + encodeURI(val[1])).join('&');
|
return $.map(arguments, (val, idx) => encodeURI(val[0]) + '=' + encodeURI(val[1])).join('&');
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{% macro branding_preview(branding_style, endpoint) %}
|
{% macro branding_preview(branding_style, endpoint) %}
|
||||||
<iframe src="{{ url_for(endpoint, branding_style=branding_style) }}" class="branding-preview"></iframe>
|
<iframe src="{{ url_for(endpoint, branding_style=branding_style) }}" class="branding-preview" scrolling="no"></iframe>
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
{% macro email_branding_preview(branding_style) %}
|
{% macro email_branding_preview(branding_style) %}
|
||||||
|
|||||||
Reference in New Issue
Block a user