improved notifications, now with animations, in center and show up properly in the dialogs

This commit is contained in:
azivner
2018-11-22 16:08:02 +01:00
parent 6cd8a2203e
commit 1db2f0c2c5
2 changed files with 63 additions and 10 deletions

View File

@@ -5,13 +5,9 @@ function showMessage(message) {
console.debug(utils.now(), "message: ", message);
$.notify({
// options
icon: 'jam jam-check',
message: message
}, {
// options
type: 'success',
delay: 3000
});
}, getNotifySettings('success', 3000));
}
function showAndLogError(message, delay = 10000) {
@@ -25,12 +21,28 @@ function showError(message, delay = 10000) {
$.notify({
// options
icon: 'jam jam-alert',
message: message
}, {
// options
type: 'danger',
}, getNotifySettings('danger', delay));
}
function getNotifySettings(type, delay) {
return {
element: (glob.activeDialog && glob.activeDialog.hasClass("show"))
? glob.activeDialog.find('.modal-header')[0]
: 'body',
type: type,
z_index: 1031,
placement: {
from: "top",
align: "center"
},
animate: {
enter: 'animated fadeInDown',
exit: 'animated fadeOutUp'
},
delay: delay
});
};
}
function throwError(message) {