Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/bundle/Resources/public/js/scripts/admin.notifications.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(function (global, doc, ibexa) {
(function (global, doc, ibexa, bootstrap) {
const notificationsContainer = doc.querySelector('.ibexa-notifications-container');
const notifications = JSON.parse(notificationsContainer.dataset.notifications);
const { template } = notificationsContainer.dataset;
Expand Down Expand Up @@ -32,7 +32,9 @@
notificationsContainer.append(notificationNode);

if (timeout) {
global.setTimeout(() => notificationNode.querySelector('.ibexa-alert__close-btn').click(), timeout);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: clicking on this button causes it to focus, which means that the focus was taken (if present on any) from another element. In case of a reported bug, the other element was the dropdown.

const alertBootstrapInstance = bootstrap.Alert.getOrCreateInstance(notificationNode);

global.setTimeout(() => alertBootstrapInstance.close(), timeout);
}

if (typeof onShow === 'function') {
Expand All @@ -45,4 +47,4 @@
});

doc.body.addEventListener('ibexa-notify', addNotification, false);
})(window, window.document, window.ibexa);
})(window, window.document, window.ibexa, window.bootstrap);
Loading