Skip to content

Commit

Permalink
[4.0] fix Media Manager hidden alerts (#32868)
Browse files Browse the repository at this point in the history
* fix

* some todos, if the other alert PRs get merged

* CS
  • Loading branch information
dgrammatiko authored Mar 26, 2021
1 parent c97dddd commit 755f836
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Notifications {
success(message, options) {
// eslint-disable-next-line no-use-before-define
notifications.notify(message, {
type: 'message',
type: 'message', // @todo rename it to success
dismiss: true,
...options,
});
Expand All @@ -15,7 +15,7 @@ class Notifications {
error(message, options) {
// eslint-disable-next-line no-use-before-define
notifications.notify(message, {
type: 'error',
type: 'error', // @todo rename it to danger
dismiss: true,
...options,
});
Expand All @@ -30,10 +30,17 @@ class Notifications {
/* Send a notification */
// eslint-disable-next-line class-methods-use-this
notify(message, options) {
let timer;
if (options.type === 'message') {
timer = 3000;
}
Joomla.renderMessages(
{
[options.type]: [Joomla.JText._(message)],
},
undefined,
true,
timer,
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion build/media_source/system/js/core.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ window.Joomla.Modal = window.Joomla.Modal || {
messagesBox.setAttribute('dismiss', 'true');

if (timeout && parseInt(timeout, 10) > 0) {
messagesBox.setAttribute('autodismiss', timeout);
messagesBox.setAttribute('auto-dismiss', timeout);
}

// Title
Expand Down

0 comments on commit 755f836

Please sign in to comment.