Merge pull request #4150 from aignatov-bio/ai-sci-5257-close-all-modals-to-esc

Fix element closing on select [SCI-5257]
This commit is contained in:
aignatov-bio 2022-06-09 12:44:59 +02:00 committed by GitHub
commit 7446e4be9b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 1 deletions

View file

@ -306,4 +306,13 @@ $(document).on('ajax:beforeSend', 'form', function() {
$(this).removeAttr('novalidate');
return this.reportValidity();
});
$(document).keyup(function(e) {
if (e.keyCode == 27) {
$('.dropdown').removeClass('open');
$('.atwho-user-popover').popover("hide");
$('.modal').modal("hide");
}
});
window.I18n = I18n

View file

@ -19,7 +19,7 @@ var DasboardCalendarWidget = (function() {
<% }); %>
<% _.each(days, function(day) { %>
<% if (day.classes.includes('event')){ %>
<div class="<%= day.classes %>" id="<%= day.id %>">
<div class="<%= day.classes %> dropdown" id="<%= day.id %>">
<div class="event-day" data-toggle="dropdown"><%= day.day %></div>
<div class="dropdown-menu events-container dropdown-menu-right" role="menu">
<div class="title">${I18n.t('dashboard.calendar.due_on')} <%= day.date.format(formatJS) %></div>

View file

@ -1,6 +1,7 @@
<div class="modal"
id="new-office-file-modal"
role="dialog"
tabindex="-1"
aria-labelledby="new-office-file-modal-label">
<%= bootstrap_form_tag url: create_wopi_file_path(),
html: { novalidate: "novalidate" },