Close modals with ESC key
Currently, when the user opens a modal window and clicks on an element that is NOT a form input and tries to close the modal window by pressing the ESC key, the modal window will not close. This patch allows the user to close modals by pressing the ESC key no matter what element on the page has the focus. The fix is taken from https://getbootstrap.com/javascript/#live-demo Co-Authored-By: Rob Cresswell <robert.cresswell@outlook.com> Change-Id: I4d19fb400dee8132d9d490507c06989c07ce42ac Closes-Bug: #1561193
This commit is contained in:
parent
e3e5eeefc4
commit
180a0d1da7
@ -1,5 +1,6 @@
|
||||
<div id="{% block modal_id %}{{ modal_id }}{% endblock %}"
|
||||
data-backdrop="{{ modal_backdrop }}"
|
||||
tabindex="-1"
|
||||
class="{% block modal_class %}{% if hide %}modal{% else %}static_page{% endif %}{% endblock %}">
|
||||
<div class="{% if hide %}modal-dialog{% endif %}">
|
||||
<div class="{% if hide %}modal-content{% endif %}">
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
{% with workflow.get_entry_point as entry_point %}
|
||||
|
||||
<div class="workflow {{ layout|join:' ' }}" data-backdrop="{{ modal_backdrop }}">
|
||||
<div class="workflow {{ layout|join:' ' }}" {% if modal %}tabindex="-1"{% endif %} data-backdrop="{{ modal_backdrop }}">
|
||||
<form {{ workflow.attr_string|safe }} action="{{ workflow.get_absolute_url }}" {% if add_to_field %}data-add-to-field="{{ add_to_field }}"{% endif %} method="POST"{% if workflow.multipart %} enctype="multipart/form-data"{% endif %}>{% csrf_token %}
|
||||
{% if REDIRECT_URL %}<input type="hidden" name="{{ workflow.redirect_param_name }}" value="{{ REDIRECT_URL }}"/>{% endif %}
|
||||
<div class="modal-dialog">
|
||||
|
Loading…
Reference in New Issue
Block a user