diff --git a/ckanext/nhs/fanstatic/css/nhs.css b/ckanext/nhs/fanstatic/css/nhs.css index 231a5db..509f939 100644 --- a/ckanext/nhs/fanstatic/css/nhs.css +++ b/ckanext/nhs/fanstatic/css/nhs.css @@ -1912,3 +1912,26 @@ blockquote { align-content: flex-start !important; } } /*# sourceMappingURL=nhs.css.map */ + + +/* Base style */ +#resource-view-iframe-fullscreen { + position: relative; +} + +#resource-view-iframe-fullscreen.is-fullscreen { + background: #fff; + overflow: auto; + padding: 1rem; + width: 100vw; + height: 100vh; + position: fixed; + top: 0; + left: 0; + z-index: 9999; +} + +/* Adjust .actions position when fullscreen-mode class is active */ +.fullscreen-mode .module-resource .actions { + right: 0 !important; +} diff --git a/ckanext/nhs/templates/package/snippets/resource_view.html b/ckanext/nhs/templates/package/snippets/resource_view.html index ce6d705..8ac8a46 100644 --- a/ckanext/nhs/templates/package/snippets/resource_view.html +++ b/ckanext/nhs/templates/package/snippets/resource_view.html @@ -25,9 +25,10 @@
- + {{ _("Fullscreen") }} @@ -81,9 +82,15 @@ {# When previewing we need to stick the whole resource_view as a param as there is no other way to pass to information on to the iframe #} {% set src = h.url_for(qualified=true, controller='package', action='resource_view', id=package['name'], resource_id=resource['id']) + '?' + h.urlencode({'resource_view': h.dump_json(resource_view)}) %} {% endif %} +
+ +
{% endif %}