Skip to content
Merged
Show file tree
Hide file tree
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
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