mirror of
https://github.com/Cacti/cacti.git
synced 2026-11-03 10:37:46 +09:00
* fix(theme): preserve Midwinter authentication controls Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * docs(changelog): describe theme fix Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * fix(ui): preserve form state and notification lifecycles Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * fix: replace the blinking timer during skin setup Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> --------- Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
70 lines
1.6 KiB
JavaScript
70 lines
1.6 KiB
JavaScript
$.toastPopup = function(options) {
|
|
var fixedOptions = {
|
|
stack: 50,
|
|
textAlign: 'left',
|
|
allowToastClose: true,
|
|
position: 'bottom-center',
|
|
showHideTransition: 'fade',
|
|
afterHidden: function (toast) {
|
|
const wrapper = toast.closest('.jq-toast-wrap');
|
|
toast.remove();
|
|
if (!wrapper.children('.jq-toast-single').length) {
|
|
wrapper.remove();
|
|
}
|
|
}
|
|
}
|
|
|
|
var defaultOptions = {
|
|
text: "No text was set, please check the usage of showToast",
|
|
hideAfter: false,
|
|
loader: true,
|
|
}
|
|
|
|
if (options === undefined) {
|
|
options = {};
|
|
} else if (typeof options === "string" || options instanceof String) {
|
|
options = {
|
|
text: String(options)
|
|
};
|
|
}
|
|
|
|
const toastOptions = $.extend(defaultOptions, options, fixedOptions);
|
|
return $.toast(toastOptions);
|
|
}
|
|
|
|
PopupWarning = function(message, heading, currentToast) {
|
|
return $.toastPopup({
|
|
text: message,
|
|
heading: heading,
|
|
icon: 'warning',
|
|
hideAfter: 20000,
|
|
}, currentToast);
|
|
}
|
|
|
|
PopupUnknown = function(message, heading, currentToast) {
|
|
return $.toastPopup({
|
|
text: message,
|
|
heading: heading,
|
|
icon: 'info',
|
|
hideAfter: false,
|
|
}, currentToast);
|
|
}
|
|
|
|
PopupError = function(message, heading, currentToast) {
|
|
return $.toastPopup({
|
|
text: message,
|
|
heading: heading,
|
|
icon: 'error',
|
|
hideAfter: false,
|
|
}, currentToast);
|
|
}
|
|
|
|
PopupNotice = function(message, heading, currentToast) {
|
|
return $.toastPopup({
|
|
text: message,
|
|
heading: heading,
|
|
icon: 'success',
|
|
hideAfter: 10000,
|
|
}, currentToast);
|
|
}
|