mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-15 03:25:42 +00:00
Remove old function
This commit is contained in:
@ -1,18 +1,10 @@
|
|||||||
function showAlert(target, message, timeout=5000) {
|
|
||||||
|
|
||||||
$(target).find(".alert-msg").html(message);
|
|
||||||
$(target).show();
|
|
||||||
$(target).delay(timeout).slideUp(200, function() {
|
|
||||||
$(this).alert(close);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function showAlertOrCache(alertType, message, cache, timeout=5000) {
|
function showAlertOrCache(alertType, message, cache, timeout=5000) {
|
||||||
if (cache) {
|
if (cache) {
|
||||||
sessionStorage.setItem("inventree-" + alertType, message);
|
sessionStorage.setItem("inventree-" + alertType, message);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
showAlert('#' + alertType, message, timeout);
|
showMessage('#' + alertType, message, timeout);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,12 +79,7 @@ function showMessage(message, options={}) {
|
|||||||
$('#alerts').append(html);
|
$('#alerts').append(html);
|
||||||
|
|
||||||
// Remove the alert automatically after a specified period of time
|
// Remove the alert automatically after a specified period of time
|
||||||
setInterval(function() {
|
$(`#alert-${id}`).delay(timeout).slideUp(200, function() {
|
||||||
$(`#alert-${id}`).animate({
|
$(this).alert(close);
|
||||||
'opacity': 0.0,
|
|
||||||
'height': '0px',
|
|
||||||
}, 250, function() {
|
|
||||||
$(`#alert-${id}`).remove();
|
|
||||||
});
|
});
|
||||||
}, timeout);
|
|
||||||
}
|
}
|
Reference in New Issue
Block a user