mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 00:07:02 -04:00
Add map in details to broadcast view
Avoided using `closest` as not supported by IE8-11 https://caniuse.com/#search=closest Used `parentElement` supported by IE9+ https://caniuse.com/#search=parentElement Used `className` as supported by IE9+ https://caniuse.com/#search=className Also rearranged the javascript for maps such that figuring out the polygon array is done first and then the time when we need to have the details component open before closing it again is kept to minimum
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
{% from "components/back-link/macro.njk" import govukBackLink %}
|
||||
{% from "components/button/macro.njk" import govukButton %}
|
||||
{% from "components/details/macro.njk" import govukDetails %}
|
||||
{% from "components/form.html" import form_wrapper %}
|
||||
{% from "components/banner.html" import banner %}
|
||||
{% from "components/page-header.html" import page_header %}
|
||||
@@ -7,6 +8,14 @@
|
||||
|
||||
{% extends "withnav_template.html" %}
|
||||
|
||||
{% block extra_stylesheets %}
|
||||
{% include "views/broadcast/partials/area-map-stylesheets.html" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block extra_javascripts %}
|
||||
{% include "views/broadcast/partials/area-map-javascripts.html" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block service_page_title %}
|
||||
{% if broadcast_message.status == 'pending-approval' %}
|
||||
{% if broadcast_message.created_by == current_user and current_user.has_permissions('send_messages') %}
|
||||
@@ -128,6 +137,11 @@
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{{ govukDetails({
|
||||
"summaryText": "Show map",
|
||||
"html": '<div id="map"></div>'
|
||||
}) }}
|
||||
|
||||
{{ broadcast_message.template|string }}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user