mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-06 03:13:42 -05: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 $form = $('form');
|
||||
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 () {
|
||||
return $.map(arguments, (val, idx) => encodeURI(val[0]) + '=' + encodeURI(val[1])).join('&');
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{% 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 %}
|
||||
|
||||
{% macro email_branding_preview(branding_style) %}
|
||||
|
||||
Reference in New Issue
Block a user