mirror of
https://github.com/zadam/trilium.git
synced 2025-11-10 23:35:50 +01:00
improved notifications, now with animations, in center and show up properly in the dialogs
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user